Files
photo-live/packages/db-cn/prisma/migrations/20260918062924_sync_entity_version/migration.sql
T
2026-09-18 15:21:41 +08:00

11 lines
940 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.
-- P2 Task 3:cn 事件补全——albums/categories/album_assets 增 entityVersion
-- (事件版本条件自增,同 photos 模式);outbox_events 增 priority
-- (normal|high:相册下线/照片隐藏删除类高优先级,发送器批次内优先投递)。
-- VARCHAR 列显式 utf8mb4_0900_bin(沿用库级约定:--create-only 后手工定校对,
-- Prisma 生成 DDL 固定 unicode_ci)。INTEGER 列无校对问题;新列全部带默认值,
-- 存量行与 P1 流程不受影响(相册/分类/资产存量行版本从 1 起算)。
ALTER TABLE `album_assets` ADD COLUMN `entityVersion` INTEGER NOT NULL DEFAULT 1;
ALTER TABLE `albums` ADD COLUMN `entityVersion` INTEGER NOT NULL DEFAULT 1;
ALTER TABLE `categories` ADD COLUMN `entityVersion` INTEGER NOT NULL DEFAULT 1;
ALTER TABLE `outbox_events` ADD COLUMN `priority` VARCHAR(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin NOT NULL DEFAULT 'normal';