2024-05-24 07:55:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateGoodsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('goods', function (Blueprint $table) {
|
2024-05-26 14:06:21 +00:00
|
|
|
$table->id();
|
2024-05-27 02:21:38 +00:00
|
|
|
$table->integer('itemid')->comment('商品id')->unique();
|
|
|
|
$table->integer('typeid')->comment('类型');
|
2024-05-24 07:55:55 +00:00
|
|
|
$table->string('product_name')->comment('商品名');
|
|
|
|
$table->string('product_code')->index()->comment('商品code');
|
|
|
|
$table->string('product_group')->comment('商品组');
|
|
|
|
$table->decimal('market_price')->comment('市场价');
|
|
|
|
$table->decimal('settlement')->comment('结算价');
|
|
|
|
$table->integer('category_id')->index()->comment('分类id');
|
|
|
|
$table->string('category_name')->comment('分类名');
|
2024-05-26 14:06:21 +00:00
|
|
|
$table->tinyInteger('state')->default(1)->comment('状态 1上架 0 下架');
|
2024-05-25 14:06:58 +00:00
|
|
|
$table->timestamps();
|
2024-05-24 07:55:55 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('goods');
|
|
|
|
}
|
|
|
|
}
|