Files
xk-api-old-laravel/database/migrations/2023_03_10_234012_create_carts_table.php
2025-01-11 14:16:20 +08:00

38 lines
965 B
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('carts', function (Blueprint $table) {
$table->comment('购物车表');
$table->id();
$table->integer('user_id')->index()->comment('用户ID');
$table->integer('drug_id')->index()->comment('药品ID');
$table->integer('store_id')->index()->comment('门店ID');
$table->mediumInteger('qty')->comment('数量');
$table->timestamp('join_at')->nullable()->comment('加入时间');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('carts');
}
};