From f1167ccb81ea935fd3209e833e8d9c61eb15314a Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Thu, 16 Feb 2023 16:19:45 +0800 Subject: [PATCH] migration --- .../2023_02_10_104133_add_spu_id_to_store_products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2023_02_10_104133_add_spu_id_to_store_products.php b/database/migrations/2023_02_10_104133_add_spu_id_to_store_products.php index d4f23456..9164b487 100644 --- a/database/migrations/2023_02_10_104133_add_spu_id_to_store_products.php +++ b/database/migrations/2023_02_10_104133_add_spu_id_to_store_products.php @@ -15,7 +15,7 @@ class AddSpuIdToStoreProducts extends Migration public function up() { Schema::table('store_product_skus', function (Blueprint $table) { - $table->unsignedBigInteger('product_spu_id'); + $table->unsignedBigInteger('product_spu_id')->null(); }); DB::statement('update `store_product_skus` set `product_spu_id` = (select `spu_id` from `product_skus` where `product_skus`.`id` = `store_product_skus`.`product_sku_id`);');