2023-07-28 21:30:45 +00:00
|
|
|
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" (
|
2023-11-25 15:59:51 +00:00
|
|
|
"tagid" INEGER NOT NULL,
|
2023-07-28 21:30:45 +00:00
|
|
|
"userid" INTEGER,
|
|
|
|
FOREIGN KEY("userid") REFERENCES "users"("id"),
|
|
|
|
PRIMARY KEY("tagid")
|
|
|
|
);
|
2023-11-24 23:05:33 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS "transaction_log" (
|
2024-02-25 16:24:44 +00:00
|
|
|
"type" TEXT NOT NULL,
|
|
|
|
"user_id" INTEGER,
|
|
|
|
"before" TEXT,
|
|
|
|
"after" TEXT,
|
|
|
|
"change" INTEGER
|
2023-11-24 23:05:33 +00:00
|
|
|
);
|
2024-02-25 16:24:44 +00:00
|
|
|
COMMIT;
|