goodsnotices/database/migrations/2024_05_24_034644_create_goods_table.php

42 lines
1.2 KiB
PHP
Raw Normal View History

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) {
$table->id('itemid')->comment('商品id');
$table->timestamps();
$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(10)->comment('状态 1正常 2 下架');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('goods');
}
}