From a2f4426058794673c4a880e9544635b71a95690a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 29 Sep 2019 14:00:47 +0200 Subject: [PATCH] Migrations: Use on update cascade --- db/migrations/ChangesReferences.php | 1 + db/migrations/Reference.php | 1 + 2 files changed, 2 insertions(+) diff --git a/db/migrations/ChangesReferences.php b/db/migrations/ChangesReferences.php index 1e7a5f10..b5b39ac3 100644 --- a/db/migrations/ChangesReferences.php +++ b/db/migrations/ChangesReferences.php @@ -31,6 +31,7 @@ trait ChangesReferences $table->foreign($reference->column) ->references($targetColumn)->on($targetTable) + ->onUpdate('cascade') ->onDelete('cascade'); } ); diff --git a/db/migrations/Reference.php b/db/migrations/Reference.php index 4c35b59b..719bee76 100644 --- a/db/migrations/Reference.php +++ b/db/migrations/Reference.php @@ -31,6 +31,7 @@ trait Reference $table->foreign($fromColumn) ->references('id')->on($targetTable) + ->onUpdate('cascade') ->onDelete('cascade'); } }