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

41 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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