Migrations: Use on update cascade
This commit is contained in:
parent
3a6d096fff
commit
a2f4426058
|
@ -31,6 +31,7 @@ trait ChangesReferences
|
||||||
|
|
||||||
$table->foreign($reference->column)
|
$table->foreign($reference->column)
|
||||||
->references($targetColumn)->on($targetTable)
|
->references($targetColumn)->on($targetTable)
|
||||||
|
->onUpdate('cascade')
|
||||||
->onDelete('cascade');
|
->onDelete('cascade');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,6 +31,7 @@ trait Reference
|
||||||
|
|
||||||
$table->foreign($fromColumn)
|
$table->foreign($fromColumn)
|
||||||
->references('id')->on($targetTable)
|
->references('id')->on($targetTable)
|
||||||
|
->onUpdate('cascade')
|
||||||
->onDelete('cascade');
|
->onDelete('cascade');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue