6
0
Fork 0

migration

base
panliang 2023-02-16 16:19:45 +08:00
parent 8da765e19f
commit f1167ccb81
1 changed files with 1 additions and 1 deletions

View File

@ -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`);');