48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateGoodsTable extends Migration {
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('goods', function(Blueprint $table)
|
|
{
|
|
$table->increments('id');
|
|
$table->integer('category_id')->unsigned()->index('category_id');
|
|
$table->string('title');
|
|
$table->string('type', 10)->nullable()->default('member')->comment('member 会员商品 pick 提货商品');
|
|
$table->string('cover');
|
|
$table->boolean('is_recommend')->default(0)->comment('平台最新推荐');
|
|
$table->boolean('is_hot_sell')->default(0)->comment('平台热销推荐');
|
|
$table->string('description');
|
|
$table->integer('stock')->unsigned()->nullable();
|
|
$table->integer('sold')->unsigned()->default(0);
|
|
$table->decimal('price', 10)->default(0.00);
|
|
$table->text('content');
|
|
$table->integer('sort')->default(0);
|
|
$table->integer('status')->default(1);
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('goods');
|
|
}
|
|
|
|
}
|