feat(content): 新增运营分类与剧单分类管理

This commit is contained in:
Zhou Weidong authored and trae-solo-agent committed 2026-10-22 22:17:58 +08:00
1 parent 758c7521bb
commit 7b360ddccd
26 files changed
+1106 -3

No files matched your search

+58 -1
View File
@@ -869,9 +869,64 @@ CREATE INDEX IF NOT EXISTS idx_audit_log_biz ON audit_log (biz_type, biz_id, cre
COMMENT ON TABLE audit_log IS '业务对象变更审计(支付、权益、定价等敏感操作)';
-- ============================================================
-- 九、updated_at 触发器(与已有表保持一致)
-- 八之二、运营分类(与短剧类型 drama_category 相互独立)
-- ============================================================
CREATE TABLE IF NOT EXISTS drama_classification (
id BIGINT PRIMARY KEY,
name VARCHAR(64) NOT NULL,
sort INTEGER NOT NULL DEFAULT 0,
status SMALLINT NOT NULL DEFAULT 1,
created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_drama_classification_name ON drama_classification (name);
COMMENT ON TABLE drama_classification IS '运营分类;与短剧类型(drama_category)相互独立';
CREATE TABLE IF NOT EXISTS drama_classification_drama (
id BIGINT PRIMARY KEY,
classification_id BIGINT NOT NULL,
drama_id BIGINT NOT NULL,
created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_classification_drama
ON drama_classification_drama (classification_id, drama_id);
CREATE INDEX IF NOT EXISTS idx_classification_drama_drama
ON drama_classification_drama (drama_id);
COMMENT ON TABLE drama_classification_drama IS '分类与短剧的关联关系';
-- ============================================================
-- 八之三、剧单(剧单有自己的一套分类,与运营分类无关)
-- ============================================================
CREATE TABLE IF NOT EXISTS drama_playlist_category (
id BIGINT PRIMARY KEY,
name VARCHAR(64) NOT NULL,
description VARCHAR(255) NOT NULL DEFAULT '',
sort INTEGER NOT NULL DEFAULT 0,
status SMALLINT NOT NULL DEFAULT 1,
created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_drama_playlist_category_name
ON drama_playlist_category (name);
COMMENT ON TABLE drama_playlist_category IS '剧单专属分类;与运营分类(drama_classification)相互独立';
CREATE TABLE IF NOT EXISTS drama_playlist_category_drama (
id BIGINT PRIMARY KEY,
category_id BIGINT NOT NULL,
drama_id BIGINT NOT NULL,
created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX IF NOT EXISTS uk_playlist_category_drama
ON drama_playlist_category_drama (category_id, drama_id);
CREATE INDEX IF NOT EXISTS idx_playlist_category_drama_drama
ON drama_playlist_category_drama (drama_id);
COMMENT ON TABLE drama_playlist_category_drama IS '剧单分类与短剧的关联关系';
-- ============================================================
-- 九、updated_at 触发器(与已有表保持一致)
-- ============================================================
DO $$
DECLARE
t TEXT;
@@ -885,6 +940,8 @@ BEGIN
'reconcile_task', 'creator', 'creator_document', 'content_submission',
'creator_stat_daily', 'creator_settlement',
'transcode_task', 'media_rendition', 'media_thumbnail',
'drama_classification',
'drama_playlist_category',
'ops_notice', 'ops_daily_stat'
]
LOOP