This commit is contained in:
toom1996
2026-09-21 19:19:03 +08:00
parent dffcf9f9e5
commit 299fd974df
11 changed files with 3392 additions and 575 deletions

View File

@ -3,9 +3,10 @@
-- pgvector 不支持 bigint -> vector 直接转换,需逐位拆成 0/1 向量(位 i -> 第 i 维,
-- 与 Go 侧 phash.ToVectorBits 完全一致,保证旧数据与新写入向量在同一语义空间可比)。
--
-- 用法(任选其一):
-- 1) 后端启动时由 AutoMigrate 自动执行(已内置,幂等,无需手动);
-- 2) 手动执行: psql "postgres://fashion:fashion_dev_2026@localhost:5432/fashion" -f 03-migrate-phash-bigint-to-vector.sql
-- 用法(仅升级旧库时需要):
-- 本迁移原先由后端启动时的 AutoMigrate(migratePhashSQL)自动执行;AutoMigrate 已移除,
-- 故升级老库改回手动执行:
-- psql "postgres://fashion:fashion_dev_2026@localhost:5432/fashion" -f 03-migrate-phash-bigint-to-vector.sql
--
-- 已为 vector/text 类型的列自动跳过;可重复执行。