<?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::table('admin_operation_logs', function (Blueprint $table) {
            $table->string('admin_name')->nullable()->comment('操作者名称')->after('admin_id');
            $table->char('admin_mobile',11)->nullable()->comment('操作者电话')->after('admin_name');
            $table->string('url')->nullable()->comment('请求地址')->after('admin_mobile');
            $table->string('route')->nullable()->comment('路由')->after('url');
            $table->string('route_title')->nullable()->comment('路由名')->after('route');
            $table->string('method')->nullable()->comment('请求方法')->after('route_title');
            $table->text('describe')->nullable()->comment('备注')->after('method');
            $table->text('response')->nullable()->comment('返回参数')->after('details');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('admin_operation_logs', function (Blueprint $table) {
            $table->dropColumn(['admin_name']);
            $table->dropColumn(['admin_mobile']);
            $table->dropColumn(['url']);
            $table->dropColumn(['route']);
            $table->dropColumn(['route_title']);
            $table->dropColumn(['method']);
            $table->dropColumn(['describe']);
            $table->dropColumn(['response']);
        });
    }
};
