feat: add settings table and backup notification functionality

This commit is contained in:
2025-12-02 11:30:13 +01:00
parent e6fab5ba31
commit eb41814c24
6 changed files with 298 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
import db from "./src/lib/db.js";
console.log("Adding settings table...");
try {
db.exec(`
CREATE TABLE IF NOT EXISTS settings (
key TEXT PRIMARY KEY,
value TEXT NOT NULL,
description TEXT,
updated_at TEXT DEFAULT CURRENT_TIMESTAMP,
updated_by TEXT,
FOREIGN KEY (updated_by) REFERENCES users(id)
);
`);
db.exec(`
INSERT OR IGNORE INTO settings (key, value, description) VALUES
('backup_notification_user_id', '', 'User ID to receive backup completion notifications');
`);
console.log("✅ Settings table created successfully");
} catch (error) {
console.error("Error creating settings table:", error);
}