Skip to content

Commit 5d67bcf

Browse files
committed
add cascade deleting in menu_items table
1 parent cf2fd2a commit 5d67bcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/cms/database/migrations/2019_11_07_112300_create_menu_items_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function up()
1818
$table->string('text');
1919
$table->string('path');
2020
$table->integer('parent_menu_item_id')->unsigned()->nullable();
21-
$table->foreign('parent_menu_item_id')->references('id')->on('menu_items');
21+
$table->foreign('parent_menu_item_id')->references('id')->on('menu_items')->onDelete('cascade');;
2222
$table->integer('order')->unsigned()->nullable();
2323
$table->boolean('active')->default(true);
2424
});

0 commit comments

Comments
 (0)