More autoincrement definition to after unique key creation

This commit is contained in:
Deon George 2021-10-01 15:04:59 +10:00
parent 7c5369203c
commit 1a92d89911
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254

View File

@ -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');
}
/**