<?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
    {
        // 线上数据库 users 表缺少 remember_token 字段，导致登录时写入报错
        Schema::table('users', function (Blueprint $table) {
            $table->string('remember_token', 100)->nullable()->after('login_count')->comment('记住我Token');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('remember_token');
        });
    }
};
