4
0
Fork 0
dcat-admin-goods/database/2022_08_19_151926_create_go...

51 lines
1.5 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('goods_cart', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->comment('用户ID');
$table->unsignedBigInteger('goods_id')->comment('商品ID');
$table->unsignedBigInteger('merchant_id')->nullable()->comment('店铺 ID');
$table->string('goods_name');
$table->string('goods_sn')->nullable();
$table->string('goods_sku_sn')->nullable();
$table->unsignedBigInteger('goods_sku_id')->nullable()->comment('商品sku ID');
$table->string('cover_image')->nullable()->comment('封面图');
$table->decimal('price', 12, 2)->comment('售价');
$table->decimal('vip_price', 12, 2)->comment('售价');
$table->json('attr')->nullable()->comment('属性');
$table->json('spec')->nullable()->comment('规格');
$table->json('part')->nullable()->comment('配件');
$table->unsignedInteger('amount')->comment('数量');
$table->timestamps();
$table->comment('购物车');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('goods_cart');
}
};