修复:reserved_until 列允许 NULL(permanent 禁用词无到期时间)

- 迁移文件补充 ->nullable()->change() 使 reserved_until 兼容 permanent 类型
- Tinker 直接执行 ALTER TABLE 修复已运行的迁移(无需回滚)
This commit is contained in:
2026-03-01 14:06:35 +08:00
parent 632a4240c4
commit 211075b77c

View File

@@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 执行迁移:新增 type reason 列。
* 执行迁移:新增 type reason ,同时将 reserved_until 改为可空
*/
public function up(): void
{
@@ -25,6 +25,9 @@ return new class extends Migration
->after('username')
->comment('temp=改名临时保留 | permanent=管理员永久禁用词');
// permanent 记录无到期时间,需要允许 NULL
$table->timestamp('reserved_until')->nullable()->change();
// 禁用原因permanent 时填写)
$table->string('reason', 100)
->nullable()