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
hmdee authored Nov 8, 2024
1 parent bfe388a commit d3919e6
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 d3919e6

Please sign in to comment.