forked from bton/matekasse
22 lines
495 B
SQL
22 lines
495 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" INEGER NOT NULL,
|
|
"userid" INTEGER,
|
|
FOREIGN KEY("userid") REFERENCES "users"("id"),
|
|
PRIMARY KEY("tagid")
|
|
);
|
|
CREATE TABLE IF NOT EXISTS "transaction_log" (
|
|
"timestamp" INTEGER NOT NULL,
|
|
"type" TEXT NOT NULL,
|
|
"user_id" INTEGER,
|
|
"before" TEXT,
|
|
"after" TEXT,
|
|
"change" INTEGER
|
|
);
|
|
COMMIT;
|