1
All checks were successful
Deploy API / deploy (push) Successful in 34s

This commit is contained in:
2026-05-26 12:08:39 +08:00
parent 09089e1335
commit b9834d9300
6 changed files with 238 additions and 16 deletions

View File

@@ -0,0 +1,33 @@
-- Preset post tags: seven-locale names for public ?lang= display.
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_en TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_ja TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_ko TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_vi TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_id TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS name_ms TEXT NOT NULL DEFAULT '';
ALTER TABLE tags ADD COLUMN IF NOT EXISTS is_preset BOOLEAN NOT NULL DEFAULT FALSE;
-- Seed preset tags (name = 简体中文; slug stable for admin UI)
INSERT INTO tags (name, slug, is_preset, name_en, name_ja, name_ko, name_vi, name_id, name_ms) VALUES
('官方推荐', 'official-recommended', TRUE, '', '', '', '', '', ''),
('新人必看', 'newcomer', TRUE, '', '', '', '', '', ''),
('本周主推', 'week-featured', TRUE, '', '', '', '', '', ''),
('可转发', 'shareable', TRUE, '', '', '', '', '', ''),
('可下载', 'downloadable', TRUE, '', '', '', '', '', ''),
('图片', 'image', TRUE, '', '', '', '', '', ''),
('视频', 'video', TRUE, '', '', '', '', '', ''),
('PPT', 'ppt', TRUE, '', '', '', '', '', ''),
('PDF', 'pdf', TRUE, '', '', '', '', '', ''),
('文案', 'copy', TRUE, '', '', '', '', '', ''),
('教程', 'tutorial', TRUE, '', '', '', '', '', ''),
('公告', 'announcement', TRUE, '', '', '', '', '', ''),
('活动', 'event', TRUE, '', '', '', '', '', ''),
('海报', 'poster', TRUE, '', '', '', '', '', ''),
('新闻', 'news', TRUE, '', '', '', '', '', ''),
('物料', 'materials', TRUE, '', '', '', '', '', ''),
('课堂', 'class', TRUE, '', '', '', '', '', ''),
('推文', 'tweet', TRUE, '', '', '', '', '', '')
ON CONFLICT (slug) DO UPDATE SET
name = EXCLUDED.name,
is_preset = TRUE;