From 211075b77cfae320149ffb5ac97d86d85808712c Mon Sep 17 00:00:00 2001 From: lkddi Date: Sun, 1 Mar 2026 14:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Areserved=5Funtil=20?= =?UTF-8?q?=E5=88=97=E5=85=81=E8=AE=B8=20NULL=EF=BC=88permanent=20?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E8=AF=8D=E6=97=A0=E5=88=B0=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 迁移文件补充 ->nullable()->change() 使 reserved_until 兼容 permanent 类型 - Tinker 直接执行 ALTER TABLE 修复已运行的迁移(无需回滚) --- ...26_03_01_135706_add_type_reason_to_username_blacklist.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/migrations/2026_03_01_135706_add_type_reason_to_username_blacklist.php b/database/migrations/2026_03_01_135706_add_type_reason_to_username_blacklist.php index e88a6b7..3b3b32f 100644 --- a/database/migrations/2026_03_01_135706_add_type_reason_to_username_blacklist.php +++ b/database/migrations/2026_03_01_135706_add_type_reason_to_username_blacklist.php @@ -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()