Skip to content

Commit 5af78ff

Browse files
committed
Fix database migrations
1 parent 0e5b864 commit 5af78ff

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

database/migrations/2021_01_14_014653_create_category_product_table.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class CreateCategoryProductTable extends Migration
1313
*/
1414
public function up()
1515
{
16-
Schema::table('category_product', function (Blueprint $table) {
17-
//
16+
Schema::create('category_product', function (Blueprint $table) {
17+
$table->integer('category_id');
18+
$table->integer('product_id');
1819
});
1920
}
2021

@@ -25,8 +26,6 @@ public function up()
2526
*/
2627
public function down()
2728
{
28-
Schema::table('category_product', function (Blueprint $table) {
29-
//
30-
});
29+
Schema::dropIfExists('category_product');
3130
}
3231
}

database/migrations/2021_01_14_014759_create_order_product_table.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ class CreateOrderProductTable extends Migration
1313
*/
1414
public function up()
1515
{
16-
Schema::table('order_product', function (Blueprint $table) {
17-
//
16+
Schema::create('order_product', function (Blueprint $table) {
17+
$table->integer('order_id');
18+
$table->integer('product_id');
19+
$table->integer('quantity')->default(1);
1820
});
1921
}
2022

@@ -25,8 +27,6 @@ public function up()
2527
*/
2628
public function down()
2729
{
28-
Schema::table('order_product', function (Blueprint $table) {
29-
//
30-
});
30+
Schema::dropIfExists('order_product');
3131
}
3232
}

0 commit comments

Comments
 (0)