pievr/internal/storage/schema.sql
stirgpea 777d4b20f3 fix: rename to pievr and write comprehensive README (#3)
Fixes capitalization to pievr and replaces README with a full, comprehensive documentation of project architecture, concepts, and roadmap.

Co-authored-by: StirGpea <stir@openclaw.local>
Reviewed-on: #3
Co-authored-by: stirgpea <stjrgpea@wivziv.com>
Co-committed-by: stirgpea <stjrgpea@wivziv.com>
2026-08-21 13:58:53 +02:00

23 lines
699 B
SQL

CREATE TABLE IF NOT EXISTS questions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
type TEXT NOT NULL,
question_text TEXT NOT NULL,
payload TEXT NOT NULL,
active BOOLEAN DEFAULT 1,
last_asked_at DATETIME,
streak INTEGER DEFAULT 0,
times_asked INTEGER DEFAULT 0,
times_correct INTEGER DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE NOT NULL
);
CREATE TABLE IF NOT EXISTS question_tags (
question_id INTEGER REFERENCES questions(id) ON DELETE CASCADE,
tag_id INTEGER REFERENCES tags(id) ON DELETE CASCADE,
PRIMARY KEY (question_id, tag_id)
);