Tlapbot/tlapbot/schema.sql

30 lines
660 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS counters;
DROP TABLE IF EXISTS redeem_queue;
2022-06-08 14:22:58 +02:00
2022-10-13 14:24:36 +02:00
CREATE TABLE IF NOT EXISTS points (
2022-06-08 14:22:58 +02:00
id TEXT PRIMARY KEY,
name TEXT,
2022-06-08 14:22:58 +02:00
points INTEGER
);
CREATE TABLE milestones (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
count INTEGER NOT NULL,
goal INTEGER NOT NULL
);
2022-10-12 15:48:18 +02:00
CREATE TABLE counters (
id INTEGER PRIMARY KEY AUTOINCREMENT,
2022-10-13 13:29:38 +02:00
name TEXT NOT NULL,
count INTEGER NOT NULL
2022-10-12 15:48:18 +02:00
);
CREATE TABLE redeem_queue (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
redeem TEXT NOT NULL,
redeemer_id TEXT NOT NULL,
note TEXT,
FOREIGN KEY (redeemer_id) REFERENCES points (id)
2022-06-08 14:22:58 +02:00
);