Initial scaffold: Go module, SQLite schema, config loader, Telegram bot with webhook/polling modes

This commit is contained in:
2026-06-23 20:22:46 +03:30
parent c803239193
commit 4146e35f35
9 changed files with 600 additions and 0 deletions

26
db/schema.sql Normal file
View 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())
);