<?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('coach_qual_records', function (Blueprint $table) {
            $table->comment('技师资质认证记录');
            $table->increments('id');
            $table->unsignedBigInteger('coach_id')->comment('技师编号');
            $table->string('qual_type')->default('')->comment('资质类型');
            $table->string('qual_no')->nullable()->comment('资质证书编号');
            $table->string('qual_photo')->default('')->comment('资质证书照片');
            $table->date('valid_start')->nullable()->comment('有效期开始日期');
            $table->date('valid_end')->nullable()->comment('有效期结束日期');
            $table->string('auditor')->nullable()->comment('审核人');
            $table->timestamp('audit_time')->nullable()->comment('审核时间');
            $table->string('audit_remark')->nullable()->comment('审核回执');
            $table->string('state')->default('PENDING')->comment('状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coach_qual_records');
    }
};
