37 lines
951 B
PHP
37 lines
951 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateGoods extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('goods', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->string('name', 200)->nullable()->comment('商品名称');
|
|
$table->string('icon', 200)->nullable()->comment('商品图标');
|
|
$table->decimal('price', 9,2)->default(0)->comment('商品价格');
|
|
$table->string('unit', 50)->nullable()->comment('商品单位');
|
|
$table->timestamps();
|
|
$table->timestamp('deleted_at')->nullable();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('goods');
|
|
}
|
|
}
|