djc-new/database/migrations/2024_01_16_181146_create_in...

37 lines
1.1 KiB
PHP
Raw Permalink 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.
*/
public function up(): void
{
Schema::create('institutions', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('名字');
$table->string('code')->nullable()->comment('简码');
$table->unsignedBigInteger('parent_id')->nullable()->default(0)->comment('上级');
$table->unsignedBigInteger('type_id')->nullable()->comment('属性keywords.id');
$table->string('address')->nullable()->comment('地址');
$table->unsignedBigInteger('person_id')->nullable()->comment('负责人persons.id');
$table->unsignedInteger('sort')->default(0)->comment('排序');
$table->string('remarks')->nullable()->comment('备注');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('institutions');
}
};