42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?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) {
|
|
$table->id();
|
|
$table->integer('itemid')->comment('商品id')->unique();
|
|
$table->integer('typeid')->comment('类型');
|
|
$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('分类名');
|
|
$table->tinyInteger('state')->default(1)->comment('状态 1上架 0 下架');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('goods');
|
|
}
|
|
}
|