update
This commit is contained in:
@ -4,8 +4,11 @@
|
||||
-- 单表之后没有 upsert 阶段,只剩入库时的「先查后插」;一次瞬时读失败或多实例并发,
|
||||
-- 就会留下两行,且两行都会通过审核进入公开视图 —— 前台出现重复内容。
|
||||
--
|
||||
-- 部分索引(WHERE is_deleted = 0):与 RunwayEntityState / StreetSnapEntityState 的查询口径一致,
|
||||
-- 软删的旧实体键不再占用,允许同实体重新入库。
|
||||
-- 部分索引(WHERE is_deleted = 0):仅约束活着行,保证「同一实体至多一行活着」。
|
||||
-- 注:入库服务层 RunwayEntityState / StreetSnapEntityState 现已**不再**以 is_deleted = 0 过滤,
|
||||
-- 软删实体也会被查到并由 worker 跳过重爬(「删除即永久」)。本索引仍保持部分索引是为了
|
||||
-- 兼容存量「软删行同键共存」的数据、避免建全量唯一索引时因历史重复而失败;结构性唯一性靠它兜底,
|
||||
-- 行为上的「删除即永久」由服务层查重保证。
|
||||
|
||||
-- 建索引前先体检:有重复则中止,避免索引创建失败留下半成品状态。
|
||||
DO $$
|
||||
|
||||
7
db/migrations/2026-09-26-01-drop-reject-reason.sql
Normal file
7
db/migrations/2026-09-26-01-drop-reject-reason.sql
Normal file
@ -0,0 +1,7 @@
|
||||
-- 移除「驳回理由」:审核流程不再要求/存储理由,删除 reject_reason 列。
|
||||
-- 视图 public_brand_runways / public_street_snaps 本就显式排除该列,无需改动。
|
||||
ALTER TABLE brand_runways
|
||||
DROP COLUMN IF EXISTS reject_reason;
|
||||
|
||||
ALTER TABLE street_snaps
|
||||
DROP COLUMN IF EXISTS reject_reason;
|
||||
12
db/migrations/2026-09-27-01-add-runway-published-at.sql
Normal file
12
db/migrations/2026-09-27-01-add-runway-published-at.sql
Normal file
@ -0,0 +1,12 @@
|
||||
-- 新增走秀发布日期列 published_at:从 Vogue 详情页 application/ld+json 的 datePublished 抽取,
|
||||
-- 以 Unix 时间戳(秒,bigint)存储,0 表示未抽取/未知,与 created_at / updated_at 的约定一致。
|
||||
--
|
||||
-- 用途:
|
||||
-- 1) 作为走秀的权威发布时间存下来(替代 created_at/updated_at 这类入库时间)。
|
||||
-- 2) 标题缺年份(year=0、season_code 为空)的秀,用发布日期的年份补全 year / season_code,
|
||||
-- 使这些秀重新可被「按年份/季节筛选」与热门排序(按 year + season_code)命中。
|
||||
--
|
||||
-- 回填为一次性操作:重跑 spider vogue 时,已存在实体走跳过分支按主键 id 写回 published_at
|
||||
-- (及缺失年份),不重下图片。
|
||||
ALTER TABLE brand_runways
|
||||
ADD COLUMN IF NOT EXISTS published_at bigint NOT NULL DEFAULT 0;
|
||||
Reference in New Issue
Block a user