return new class extends Migration { public function up(): void { Schema::create('transactions', function (Blueprint $table) { $table->id(); $table->string('paystack_reference')->unique(); $table->string('voter_name'); $table->string('voter_email'); $table->string('voter_phone')->nullable(); $table->foreignId('nominee_id')->constrained()->cascadeOnDelete(); $table->unsignedInteger('vote_count'); $table->decimal('amount_paid', 12, 2); $table->enum('status', ['pending', 'success', 'failed'])->default('pending'); $table->timestamp('paid_at')->nullable(); $table->timestamps(); $table->index(['status', 'nominee_id']); }); } public function down(): void { Schema::dropIfExists('transactions'); } };