Files
backend_v2/db/migrations/2026-09-22-05-drop-draft-tables.sql
toom1996 f04b5707cb fix(publish): 最终审查补修(编辑页删图重算计数、迁移编号后置、图片 id 稳定断言)
D1 编辑页删图:DeleteRunwayImage/DeleteSnapImage 在单事务内取父 id→软删→按存活行重算 image_count,口径与审核侧 SoftDelete*Image 完全一致(走秀只计主图、街拍计全部),并补集成测试(含重复删同一张)

D2 不可逆删表迁移 02→05(git mv),使文件名顺序 01→01b→03→04→05 与必需执行顺序一致;同步 README/文件头/规格/计划全部引用

D3 新增「通过审核后图片行 id 集合完全一致」的集成断言,锁住单表发布头号收益

D4 修正 01 迁移文件头「只做三件事」自相矛盾表述;D5 删除受版本控制的陈旧产物 cmd/dbtool/db_dump.json 并加 gitignore 规则;D6 清理遗留空目录 scripts/tmp_verify/
2026-09-23 16:27:14 +08:00

11 lines
548 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.

-- 单表发布模型收尾:删除 4 张草稿表。
--
-- ⚠️ 执行前置条件:一次性搬迁脚本 scripts/migrate_single_table/main.go(已随本次改造从工作树删除,
-- 取回方式见本目录 README.md)已跑完且校验通过 —— 否则草稿数据会丢失。
-- 本迁移不可逆:执行前请确认 db/backups 有可用备份。
DROP TABLE IF EXISTS brand_runway_draft_images;
DROP TABLE IF EXISTS brand_runway_drafts;
DROP TABLE IF EXISTS street_snap_draft_images;
DROP TABLE IF EXISTS street_snap_drafts;