dropIfExists('store_receipt_order_match_rows'); $schema->create('store_receipt_order_match_rows', function (Blueprint $table): void { $table->increments('id'); $table->date('report_month'); $table->string('platform', 32); $table->string('store_name', 191)->nullable(); $table->string('online_order_no', 64)->nullable(); $table->decimal('difference', 20, 4)->nullable(); }); $migration = require database_path( 'migrations/2026_10_24_210000_add_cross_month_balanced_to_store_receipt_order_match_rows.php' ); $migration->up(); $this->assertTrue($schema->hasColumn('store_receipt_order_match_rows', 'cross_month_balanced')); $this->assertTrue(collect($schema->getIndexes('store_receipt_order_match_rows')) ->contains(static fn (array $index): bool => ($index['name'] ?? null) === 'store_receipt_cross_month_lookup_index')); $this->assertSame(0, DB::connection($connection)->table('store_receipt_order_match_rows')->count()); $migration->down(); $this->assertFalse($schema->hasColumn('store_receipt_order_match_rows', 'cross_month_balanced')); $this->assertFalse(collect($schema->getIndexes('store_receipt_order_match_rows')) ->contains(static fn (array $index): bool => ($index['name'] ?? null) === 'store_receipt_cross_month_lookup_index')); } }