6
0
Fork 0

migration

base
panliang 2023-02-16 16:22:08 +08:00
parent f1167ccb81
commit c5e46383ab
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')->null();
$table->unsignedBigInteger('product_spu_id')->nullable();
});
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`);');