diff --git a/database/migrations/2021_09_30_132207_rework_charges.php b/database/migrations/2021_09_30_132207_rework_charges.php index 9942bc8..d498495 100644 --- a/database/migrations/2021_09_30_132207_rework_charges.php +++ b/database/migrations/2021_09_30_132207_rework_charges.php @@ -25,7 +25,6 @@ class ReworkCharges extends Migration DB::statement('ALTER TABLE ab_charge RENAME TO charges'); DB::statement('ALTER TABLE charges RENAME COLUMN date_charge TO charge_date'); - DB::statement('ALTER TABLE charges MODIFY COLUMN id INT auto_increment'); Schema::table('charges', function (Blueprint $table) { $table->unique(['id','account_id','site_id']); @@ -35,6 +34,8 @@ class ReworkCharges extends Migration $table->integer('user_id')->unsigned()->nullable(); $table->foreign(['user_id','site_id'])->references(['id','site_id'])->on('users'); }); + + DB::statement('ALTER TABLE charges MODIFY COLUMN id INT auto_increment'); } /**