fix:修复相关问题,新增留言查看

This commit is contained in:
Daniel
2026-03-06 11:41:09 +08:00
parent cbac58af62
commit 97b04b6ccc
10 changed files with 252 additions and 12 deletions

View File

@@ -227,6 +227,11 @@ function runMigrations(db) {
created_at TEXT NOT NULL DEFAULT (datetime('now'))
)
`)
const fbCols = prepare('PRAGMA table_info(feedback)').all()
const fbNames = (fbCols || []).map((c) => c.name)
if (!fbNames.includes('created_at')) {
exec('ALTER TABLE feedback ADD COLUMN created_at TEXT NOT NULL DEFAULT (datetime(\'now\'))')
}
} catch (_) {}
try {
exec(`
@@ -308,6 +313,11 @@ function runMigrations(db) {
config TEXT NOT NULL,
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);
CREATE TABLE IF NOT EXISTS crawler_config (
id INTEGER PRIMARY KEY CHECK (id = 1),
rss_interval_sec INTEGER NOT NULL DEFAULT 60
);
INSERT OR IGNORE INTO crawler_config (id, rss_interval_sec) VALUES (1, 60);
`)
} catch (_) {}