refactor(comment): 统一字段命名并改用时间戳存储创建时间

将 author 字段重命名为 name,pub_date 改为 created 并使用时间戳存储
更新相关 API、数据库 schema 和前端组件以适配新字段
同时将 user_agent 简化为 ua 并改进日期处理逻辑
This commit is contained in:
anghunk
2026-01-20 13:50:08 +08:00
parent 520cfcc447
commit eb0a7a32aa
15 changed files with 112 additions and 99 deletions

View File

@@ -1,16 +1,16 @@
-- create comment table
CREATE TABLE IF NOT EXISTS Comment (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pub_date DATETIME DEFAULT CURRENT_TIMESTAMP,
created INTEGER NOT NULL,
post_slug TEXT NOT NULL,
author TEXT NOT NULL,
name TEXT NOT NULL,
email TEXT NOT NULL,
url TEXT,
ip_address TEXT,
device TEXT,
os TEXT,
browser TEXT,
user_agent TEXT,
ua TEXT,
content_text TEXT NOT NULL,
content_html TEXT NOT NULL,
parent_id INTEGER,