Files
crawler-plugin/backend-java/docs/rollback-V155-users-disabled-at.sql
T
huangzd1997 49f786f30f feat(停用): V155 给 users 加 disabled_at——停用第一次有账号级载体
生产 users 只有 11 列、无任何状态列,expires_at 140 行全 NULL,所以停用既无字段可落、
也不能借 machine(那是测试号签名 + 互踢判定在用)。不复用 expires_at 塞哨兵:取消停用
会把收费到期日一起抹掉。两张 users 实体同批改,少一张就有一条鉴权路径读不到。

台账同步:文件数 153、范围 V1..V155、取号起点推到 V156
2026-10-09 14:30:57 +08:00

16 lines
898 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 回滚 V155(users.disabled_at)——人工执行,放在 Flyway 扫描路径之外。
-- 理由:把回滚也做成版本化迁移,等于让"决定回滚"这件事自己发生(V150/V152/V154 同款处置)。
--
-- 只在"这列不该加"时才跑。仅仅回滚 jar 不需要它:旧 jar 不认识 disabled_at,留着 NULL 列零影响。
--
-- 顺序:停两台 java → 跑本文件 → 删 flyway_schema_history 的 version='155' 行 → 回滚 jar → 起 java。
--
-- ⚠ 跑之前先确认没有非 NULL 的停用行,否则 DROP COLUMN 会把停用记录一起抹掉、事后无从追认:
-- SELECT COUNT(*) FROM `users` WHERE `disabled_at` IS NOT NULL; -- 期望 0
ALTER TABLE `users` DROP COLUMN `disabled_at`;
-- 复核:
-- SHOW COLUMNS FROM `users` LIKE 'disabled_at'; -- 期望 Empty set
-- DELETE FROM flyway_schema_history WHERE version = '155';