更新docker构建cd (#10)
* update github actions * update github actions * update github actions * update github actions * update github actions * update github actions * update github actions --------- Co-authored-by: Kevin <kevin@brighteng.org>
This commit is contained in:
@@ -14,6 +14,22 @@ CREATE TABLE IF NOT EXISTS chapter_sections (
|
||||
CREATE INDEX IF NOT EXISTS ix_chapter_sections_chapter_id ON chapter_sections(chapter_id);
|
||||
CREATE INDEX IF NOT EXISTS ix_chapter_sections_order ON chapter_sections(chapter_id, order_index);
|
||||
|
||||
-- 若 chapter_sections 已存在且已提前切换到 image_id 结构,重跑迁移时需要临时补回 image 列,
|
||||
-- 以便后续 Python 脚本先完成 JSON -> memoir_images 的数据搬迁。
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'chapter_sections'
|
||||
AND column_name = 'image'
|
||||
) THEN
|
||||
ALTER TABLE chapter_sections ADD COLUMN image JSONB;
|
||||
RAISE NOTICE '已补回 chapter_sections.image,供数据迁移使用';
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- ========== 2. chapters 表增加 cover_image ==========
|
||||
DO $$
|
||||
BEGIN
|
||||
|
||||
Reference in New Issue
Block a user