v0.2.4: fix ad key-words comma split + deleteAdFiles entry for extensions only
This commit is contained in:
@@ -245,6 +245,30 @@ function migrateCloudConfigs(db: Database.Database): void {
|
||||
console.log('[DB] cloud_configs migration: is_transfer_enabled column added');
|
||||
}
|
||||
}
|
||||
// Migration 6: Add notify_config JSON column for per-config notification settings
|
||||
const row6 = db!.prepare("SELECT sql FROM sqlite_master WHERE name='cloud_configs' AND sql LIKE '%notify_config%'").get();
|
||||
if (!row6) {
|
||||
db!.exec("ALTER TABLE cloud_configs ADD COLUMN notify_config TEXT DEFAULT '{}'");
|
||||
console.log('[DB] cloud_configs migration: notify_config column added');
|
||||
}
|
||||
|
||||
// Migration 7: Add push_users table for multi-user notification settings
|
||||
const hasPushUsers = db!.prepare(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='push_users'"
|
||||
).get();
|
||||
if (!hasPushUsers) {
|
||||
db!.exec(
|
||||
`CREATE TABLE IF NOT EXISTS push_users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
account TEXT NOT NULL UNIQUE,
|
||||
notify_config TEXT DEFAULT '{}',
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now', 'localtime')),
|
||||
updated_at TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))
|
||||
)`
|
||||
);
|
||||
console.log('[DB] push_users table created');
|
||||
}
|
||||
|
||||
|
||||
function seedAdmin(db: Database.Database): void {
|
||||
const existing = db.prepare('SELECT id FROM admins WHERE username = ?').get(config.adminUsername);
|
||||
|
||||
Reference in New Issue
Block a user