1
0
Fork 0
forked from bton/matekasse
matekasse/Website/schema.sql
2023-11-25 00:05:33 +01:00

21 lines
No EOL
487 B
SQL

BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "users" (
"id" INTEGER NOT NULL,
"username" TEXT NOT NULL,
"balance" INTEGER NOT NULL,
PRIMARY KEY("id")
);
CREATE TABLE IF NOT EXISTS "tags" (
"tagid" INTEGER NOT NULL,
"userid" INTEGER,
FOREIGN KEY("userid") REFERENCES "users"("id"),
PRIMARY KEY("tagid")
);
CREATE TABLE IF NOT EXISTS "transaction_log" (
"timestamp" INTEGER NOT NULL,
"userid" INTEGER NOT NULL,
"type" TEXT NOT NULL,
"before" TEXT,
"after" TEXT
);
COMMIT;