增加数据库表的comment

This commit is contained in:
TL 2023-01-16 09:32:37 +08:00 committed by Edward Yang
parent 30b7f7e33f
commit 1b4c5bf027
3 changed files with 6 additions and 5 deletions

View File

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

View File

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

View File

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