Update
This commit is contained in:
@@ -13,6 +13,8 @@ CREATE TABLE IF NOT EXISTS redeploy_logs (
|
|||||||
);
|
);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
db.exec(createRedeployLogsTable);
|
db.exec(createRedeployLogsTable);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -28,4 +30,17 @@ try {
|
|||||||
|
|
||||||
console.log('✅ redeploy_logs table ready');
|
console.log('✅ redeploy_logs table ready');
|
||||||
|
|
||||||
|
const createSettingsTable = `
|
||||||
|
CREATE TABLE IF NOT EXISTS settings (
|
||||||
|
key TEXT PRIMARY KEY,
|
||||||
|
value TEXT,
|
||||||
|
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
|
||||||
|
)
|
||||||
|
`;
|
||||||
|
|
||||||
|
db.exec(createSettingsTable);
|
||||||
|
|
||||||
|
console.log('✅ settings table ready');
|
||||||
|
|
||||||
|
|
||||||
db.close();
|
db.close();
|
||||||
|
|||||||
@@ -1,15 +1,5 @@
|
|||||||
import { db } from './index.js';
|
import { db } from './index.js';
|
||||||
|
|
||||||
const CREATE_TABLE_SQL = `
|
|
||||||
CREATE TABLE IF NOT EXISTS settings (
|
|
||||||
key TEXT PRIMARY KEY,
|
|
||||||
value TEXT,
|
|
||||||
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
|
|
||||||
)
|
|
||||||
`;
|
|
||||||
|
|
||||||
db.prepare(CREATE_TABLE_SQL).run();
|
|
||||||
|
|
||||||
const getSettingStmt = db.prepare('SELECT key, value, updated_at FROM settings WHERE key = ?');
|
const getSettingStmt = db.prepare('SELECT key, value, updated_at FROM settings WHERE key = ?');
|
||||||
const setSettingStmt = db.prepare(`
|
const setSettingStmt = db.prepare(`
|
||||||
INSERT INTO settings (key, value, updated_at)
|
INSERT INTO settings (key, value, updated_at)
|
||||||
|
|||||||
Reference in New Issue
Block a user