fix(publish): 迁移03街拍体检同步 city+year+title 口径,补 04 体检与查重口径测试

This commit is contained in:
toom1996
2026-09-23 13:14:48 +08:00
parent ce4f8b786d
commit 12d05f75e9
4 changed files with 84 additions and 5 deletions

View File

@ -20,10 +20,12 @@ BEGIN
RAISE EXCEPTION 'brand_runways 有 % 组重复实体键,请先人工合并再加唯一索引', dup;
END IF;
-- 口径已随任务 3c 的实体键细化同步为 (city, year, title):否则本文件在「同城同年多专题」
-- 的合法数据上不再幂等(重复执行会误报重复而中止)。
SELECT count(*) INTO dup FROM (
SELECT city, year
SELECT city, year, COALESCE(title, '')
FROM street_snaps WHERE is_deleted = 0
GROUP BY 1, 2 HAVING count(*) > 1
GROUP BY 1, 2, 3 HAVING count(*) > 1
) t;
IF dup > 0 THEN
RAISE EXCEPTION 'street_snaps 有 % 组重复实体键,请先人工合并再加唯一索引', dup;