migration
parent
f1167ccb81
commit
c5e46383ab
|
|
@ -15,7 +15,7 @@ class AddSpuIdToStoreProducts extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('store_product_skus', function (Blueprint $table) {
|
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`);');
|
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`);');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue