feat: 文章属性 — Post Model 扩展 + 置顶系统
- Post 新增 7 字段:Visibility/PostType/ReprintSource/Declaration/ReprintProhibited/PinType/PinnedAt - 公开列表过滤 private 文章(管理员可见全部) - 列表排序:全局置顶 > 按时间 - declarationLabel 模板函数(7 种创作声明) - Pin/Unpin API(admin+,category/global 两种置顶类型)
This commit is contained in:
8
docs/migrations/003_post_attributes.sql
Normal file
8
docs/migrations/003_post_attributes.sql
Normal file
@ -0,0 +1,8 @@
|
||||
-- 文章属性扩展
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS visibility VARCHAR(10) DEFAULT 'public';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS post_type VARCHAR(10) DEFAULT 'original';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS reprint_source VARCHAR(500) DEFAULT '';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS declaration VARCHAR(30) DEFAULT '';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS reprint_prohibited BOOLEAN DEFAULT false;
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS pin_type VARCHAR(10) DEFAULT '';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS pinned_at TIMESTAMP;
|
||||
Reference in New Issue
Block a user