fix(db): photos 查重索引补 schema 声明——消除 migrate dev 误提议 DROP 漂移

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-28 22:49:43 +08:00
parent 726f6a1be8
commit 318f69dae7
+4
View File
@@ -174,6 +174,10 @@ model photos {
entityVersion Int @default(1)
@@index([albumId, visibility, publishedAt, id])
@@index([albumId, uploaderId, uploadedAt])
// 查重索引声明回填(P0-1 层 2):索引由迁移 20260928120000 手写 SQL 创建
// (同相册+上传者+字节数匹配,命中即 409 PHOTO_DUPLICATE);此处补声明使
// schema ↔ 迁移历史一致,消除 migrate dev 误提议 DROP 的漂移(2026-09-28)。
@@index([albumId, uploaderId, bytes], map: "idx_photos_dedup")
}
model photo_variants {
photoId String @db.VarChar(64)