feat: add settings table and backup notification functionality
This commit is contained in:
25
migrate-add-settings-table.mjs
Normal file
25
migrate-add-settings-table.mjs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user