diff --git a/database/migrations/2022_12_30_110019_create_product_related.php b/database/migrations/2022_12_30_110019_create_product_related.php index 7c26731f..83ab9e86 100644 --- a/database/migrations/2022_12_30_110019_create_product_related.php +++ b/database/migrations/2022_12_30_110019_create_product_related.php @@ -14,6 +14,7 @@ return new class extends Migration public function up() { Schema::create('product_relations', function (Blueprint $table) { + $table->comment('相关商品表'); $table->id(); $table->unsignedInteger('product_id')->comment('商品 ID')->index('product_id'); $table->unsignedInteger('relation_id')->comment('关联商品 ID')->index('relation_id'); diff --git a/database/migrations/2022_12_30_165725_guest_checkout.php b/database/migrations/2022_12_30_165725_guest_checkout.php index ecfb587f..d503b6dd 100644 --- a/database/migrations/2022_12_30_165725_guest_checkout.php +++ b/database/migrations/2022_12_30_165725_guest_checkout.php @@ -18,12 +18,12 @@ return new class extends Migration } Schema::table('carts', function (Blueprint $table) { - $table->string('session_id')->default('')->after('customer_id'); - $table->json('guest_shipping_address')->nullable()->after('shipping_address_id'); - $table->json('guest_payment_address')->nullable()->after('payment_address_id'); + $table->string('session_id')->comment('当前用户会话 ID')->default('')->after('customer_id'); + $table->json('guest_shipping_address')->comment('游客配送地址')->nullable()->after('shipping_address_id'); + $table->json('guest_payment_address')->comment('游客发票地址')->nullable()->after('payment_address_id'); }); Schema::table('cart_products', function (Blueprint $table) { - $table->string('session_id')->default('')->after('customer_id'); + $table->string('session_id')->comment('当前用户会话 ID')->default('')->after('customer_id'); }); } diff --git a/database/migrations/2023_01_10_115702_add_sales2_product.php b/database/migrations/2023_01_10_115702_add_sales2_product.php index 4b076755..44263cd7 100644 --- a/database/migrations/2023_01_10_115702_add_sales2_product.php +++ b/database/migrations/2023_01_10_115702_add_sales2_product.php @@ -18,7 +18,7 @@ return new class extends Migration } Schema::table('products', function (Blueprint $table) { - $table->integer('sales')->default(0)->after('tax_class_id'); + $table->integer('sales')->comment('销量')->default(0)->after('tax_class_id'); }); }