remove disable FK check on migrate
This commit is contained in:
parent
5ea039ccfe
commit
8622dfd2bd
1 changed files with 1 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ class UpdateDocumentTable extends Migration
|
|||
DB::statement('ALTER TABLE `documents` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP');
|
||||
|
||||
self::updateData();
|
||||
Schema::disableForeignKeyConstraints();
|
||||
// * Set all orphans documents
|
||||
Schema::table('documents', function (Blueprint $table) {
|
||||
$table->bigInteger('parent')->unsigned()->change();
|
||||
$table->renameColumn('directory', 'directory_id');
|
||||
|
|
@ -48,7 +48,6 @@ class UpdateDocumentTable extends Migration
|
|||
$table->renameColumn('published', 'status');
|
||||
$table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change();
|
||||
});
|
||||
Schema::enableForeignKeyConstraints();
|
||||
foreach ($this->documentsNew as $key => $documentNew) {
|
||||
$documentNew->document_id =
|
||||
($this->documentsOld[$key]->parent !== null) ? intval($this->documentsOld[$key]->parent) : null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue