Initial scaffold: Go module, SQLite schema, config loader, Telegram bot with webhook/polling modes
This commit is contained in:
26
db/schema.sql
Normal file
26
db/schema.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
CREATE TABLE events (
|
||||
id INTEGER PRIMARY KEY,
|
||||
event_type TEXT NOT NULL
|
||||
CHECK (event_type IN ('in', 'out')),
|
||||
occurred_at INTEGER NOT NULL UNIQUE
|
||||
CHECK (occurred_at > 0),
|
||||
note TEXT NOT NULL DEFAULT '',
|
||||
created_at INTEGER NOT NULL
|
||||
DEFAULT (unixepoch())
|
||||
);
|
||||
|
||||
CREATE INDEX idx_events_occurred_at
|
||||
ON events(occurred_at);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE TABLE days_off (
|
||||
date TEXT PRIMARY KEY
|
||||
CHECK (date = strftime('%Y-%m-%d', date)),
|
||||
reason TEXT NOT NULL DEFAULT '',
|
||||
created_at INTEGER NOT NULL
|
||||
DEFAULT (unixepoch())
|
||||
);
|
||||
Reference in New Issue
Block a user