123456789101112131415161718192021222324252627282930313233343536 |
- <?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('system_departments', function (Blueprint $table) {
- $table->id();
- $table->string('name')->comment('部门名称');
- $table->bigInteger('parent_id')->default(0)->comment('父部门ID');
- $table->integer('sort')->default(0)->comment('显示顺序');
- $table->bigInteger('leader_user_id')->nullable()->comment('负责人');
- $table->string('phone')->nullable()->comment('联系电话');
- $table->string('email')->nullable()->comment('邮箱');
- $table->tinyInteger('status')->default(0)->comment('部门状态');
- $table->string('creator', 64)->nullable()->comment('创建者');
- $table->string('updater', 64)->nullable()->comment('更新者');
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('system_departments');
- }
- };
|