Enchanting tiger
This commit is contained in:
41
idea.md
Normal file
41
idea.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
To have vim style CRUD for alarms in sqlite database.
|
||||||
|
|
||||||
|
The database scheme:
|
||||||
|
"""
|
||||||
|
CREATE TABLE alarms (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
description TEXT,
|
||||||
|
time TEXT, -- HH:MM format for simple alarms
|
||||||
|
trigger TEXT NOT NULL, -- Cron expression or 'once'
|
||||||
|
sound_path TEXT NOT NULL,
|
||||||
|
enabled BOOLEAN DEFAULT 1,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
last_triggered TIMESTAMP,
|
||||||
|
snooze_count INTEGER DEFAULT 0
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE alarm_history (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
alarm_id INTEGER,
|
||||||
|
triggered_at TIMESTAMP,
|
||||||
|
dismissed_at TIMESTAMP,
|
||||||
|
snoozed_count INTEGER,
|
||||||
|
FOREIGN KEY (alarm_id) REFERENCES alarms(id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE settings (
|
||||||
|
key TEXT PRIMARY KEY,
|
||||||
|
value TEXT
|
||||||
|
);
|
||||||
|
"""
|
||||||
|
|
||||||
|
To be run in Linux terminals.
|
||||||
|
Needs to have a list of existing alarms.
|
||||||
|
|
||||||
|
Needs way to:
|
||||||
|
1. create alarms to the database (add)
|
||||||
|
2. read alarms that are in the database (view)
|
||||||
|
3. update alarms that are in the database (edit)
|
||||||
|
4. delete alarms from the database (delete)
|
||||||
Reference in New Issue
Block a user