41 lines
1.2 KiB
PHP
41 lines
1.2 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->unsignedTinyInteger('crop_type')->default(1)->comment('1基地农作物,2镇街农作物');
|
||
$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');
|
||
}
|
||
};
|