This commit is contained in:
2026-01-27 21:47:05 +05:00
parent 9714ac5004
commit 1fa78bf7a7
9 changed files with 2127 additions and 673 deletions

View File

@@ -93,6 +93,18 @@ function initializeSQLite() {
}
function createSQLiteTables() {
// notification_history
db.run(`CREATE TABLE IF NOT EXISTS notification_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
task_id INTEGER NOT NULL,
notification_type TEXT NOT NULL,
last_sent_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users (id),
FOREIGN KEY (task_id) REFERENCES tasks (id),
UNIQUE(user_id, task_id, notification_type)
)`);
// SQLite таблицы
db.run(`CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,