<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('positions', function (Blueprint $table) {
            $table->string('code', 50)->nullable()->after('name')->comment('职务编码');
            $table->tinyInteger('status')->default(1)->after('sort')->comment('1启用 0停用');
            $table->string('description', 255)->nullable()->after('status')->comment('备注');
        });
    }

    public function down(): void
    {
        Schema::table('positions', function (Blueprint $table) {
            $table->dropColumn(['code', 'status', 'description']);
        });
    }
};
