lcly-data-admin/database/migrations/2022_10_21_105432_create_cr...

40 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('crops', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('category_id')->comment('行业ID');
$table->unsignedBigInteger('parent_id')->nullable()->comment('父级ID');
$table->string('name')->comment('名称');
$table->string('path')->nullable()->comment('路径');
$table->unsignedTinyInteger('is_end')->default(0)->comment('是否结点');
$table->string('unit')->nullable()->comment('单位');
$table->unsignedInteger('sort')->default(0)->comment('排序');
$table->text('extends')->nullable()->comment('扩展字段');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('crop_cates');
}
};