feat(publish): 正式表加发布状态与公开只读视图
This commit is contained in:
9
db/migrations/2026-09-22-01b-publish-existing-rows.sql
Normal file
9
db/migrations/2026-09-22-01b-publish-existing-rows.sql
Normal file
@ -0,0 +1,9 @@
|
||||
-- 一次性数据迁移:把存量正式行视为已发布。
|
||||
--
|
||||
-- ⚠️ 只执行一次;必须在部署本计划的新代码之前、且在 scripts/migrate_single_table 之前执行。
|
||||
-- 为什么单独成文件而不放进可重复执行的 2026-09-22-01:
|
||||
-- 数据搬迁会把 pending 草稿连同旧的 created_at 一起搬进正式表;
|
||||
-- 若这条 UPDATE 可被重复执行(集成测试每次都会跑 01 号文件),
|
||||
-- 这些待审内容会被误刷成 published —— 恰好是本设计要防的泄漏。
|
||||
UPDATE brand_runways SET status = 'published' WHERE status = 'pending';
|
||||
UPDATE street_snaps SET status = 'published' WHERE status = 'pending';
|
||||
Reference in New Issue
Block a user