12h
This commit is contained in:
12
database.js
12
database.js
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user