love_php/database/migrations/2018_06_14_192037_create_goods.php
2026-04-02 09:20:51 +08:00

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');
}
}