Files
backend_v2/db/migrations/2026-09-22-01b-publish-existing-rows.sql

10 lines
681 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.

-- 一次性数据迁移:把存量正式行视为已发布。
--
-- ⚠️ 只执行一次;必须在部署本计划的新代码之前、且在 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';