More autoincrement definition to after unique key creation
This commit is contained in:
parent
7c5369203c
commit
1a92d89911
@ -25,7 +25,6 @@ class ReworkCharges extends Migration
|
|||||||
|
|
||||||
DB::statement('ALTER TABLE ab_charge RENAME TO charges');
|
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 RENAME COLUMN date_charge TO charge_date');
|
||||||
DB::statement('ALTER TABLE charges MODIFY COLUMN id INT auto_increment');
|
|
||||||
|
|
||||||
Schema::table('charges', function (Blueprint $table) {
|
Schema::table('charges', function (Blueprint $table) {
|
||||||
$table->unique(['id','account_id','site_id']);
|
$table->unique(['id','account_id','site_id']);
|
||||||
@ -35,6 +34,8 @@ class ReworkCharges extends Migration
|
|||||||
$table->integer('user_id')->unsigned()->nullable();
|
$table->integer('user_id')->unsigned()->nullable();
|
||||||
$table->foreign(['user_id','site_id'])->references(['id','site_id'])->on('users');
|
$table->foreign(['user_id','site_id'])->references(['id','site_id'])->on('users');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DB::statement('ALTER TABLE charges MODIFY COLUMN id INT auto_increment');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user