finish implementing database schema

This commit is contained in:
mykola2312 2024-06-17 20:37:01 +03:00
parent fb4e832fe6
commit 30613f8cb4

View file

@ -25,3 +25,28 @@ CREATE TABLE "file" (
FOREIGN KEY(torrent_id) REFERENCES "torrent"(id) FOREIGN KEY(torrent_id) REFERENCES "torrent"(id)
); );
CREATE TABLE "category" (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
forum_id INTEGER NOT NULL
);
CREATE TABLE "torrent_category" (
id INTEGER PRIMARY KEY AUTOINCREMENT,
torrent_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
FOREIGN KEY(torrent_id) REFERENCES "torrent"(id),
FOREIGN KEY(category_id) REFERENCES "category"(id)
);
CREATE TABLE "deletion" (
id INTEGER PRIMARY KEY AUTOINCREMENT,
torrent_id INTEGER NOT NULL,
FOREIGN KEY(torrent_id) REFERENCES "torrent"(id)
);