Skip to content

Commit

Permalink
Update 2021_11_09_082205_create_products_table.php
Browse files Browse the repository at this point in the history
  • Loading branch information
OhmygoodR authored Nov 6, 2023
1 parent 894f343 commit 981086e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up()
// TASK: Edit this file, so that deleting category would auto-delete its products
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id')->constrained();
$table->foreignId('category_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->timestamps();
});
Expand Down

0 comments on commit 981086e

Please sign in to comment.