merge: fix/p-episode-groups

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-06 16:02:17 +08:00
commit 02b9773047
35 files changed
+2751 -154

No files matched your search

@@ -0,0 +1,31 @@
import type { Kysely } from "kysely";
import { execDdl } from "../src/migration-helpers.ts";
// 作品的季集结构(剧集组):null = TMDB 默认季;否则为 TMDB 剧集组 id(/tv/episode_group/{id}),季表与季 / 集单元按组生成。
// 名称冗余存一份(界面显示不用再查 TMDB);选择时间与操作者(`<actor_type>:<actor_id>`)供审计与界面「谁改的」。
// biome-ignore lint/suspicious/noExplicitAny: 迁移不依赖应用表类型
export async function up(db: Kysely<any>): Promise<void> {
await execDdl(
db,
`
alter table media_entity add column episode_group_id text;
alter table media_entity add column episode_group_name text;
alter table media_entity add column episode_group_set_at timestamptz;
alter table media_entity add column episode_group_set_by text;
`,
);
}
// biome-ignore lint/suspicious/noExplicitAny: 同上
export async function down(db: Kysely<any>): Promise<void> {
await execDdl(
db,
`
alter table media_entity drop column if exists episode_group_set_by;
alter table media_entity drop column if exists episode_group_set_at;
alter table media_entity drop column if exists episode_group_name;
alter table media_entity drop column if exists episode_group_id;
`,
);
}