<?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('partners', function (Blueprint $table) {
            $table->integer('status')->default(0)->after('agency_date')->comment('审核状态:0审核中,1审核通过,2拒绝');
            $table->string('refusal_reason')->nullable()->after('status')->comment('拒绝原因');
            $table->timestamp('audit_at')->nullable()->after('refusal_reason')->comment('审核时间');
        });

        Schema::table('coaches', function (Blueprint $table) {
            $table->integer('status')->default(0)->after('think')->comment('审核状态:0审核中,1审核通过,2拒绝');
            $table->string('refusal_reason')->nullable()->after('status')->comment('拒绝原因');
            $table->timestamp('audit_at')->nullable()->after('refusal_reason')->comment('审核时间');
        });
    }

    public function down(): void
    {
        Schema::table('partners', function (Blueprint $table) {
            //
            $table->dropColumn('status');
            $table->dropColumn('refusal_reason');
            $table->dropColumn('audit_at');
        });

        Schema::table('coaches', function (Blueprint $table) {
            //
            $table->dropColumn('status');
            $table->dropColumn('refusal_reason');
            $table->dropColumn('audit_at');
        });
    }
};
