Maybe final DB table

feat/db
Antonio De Lucreziis 2 years ago
parent 2ce1ac9bf1
commit 2485133661

@ -13,29 +13,31 @@ CREATE TABLE IF NOT EXISTS "dispense"(
); );
-- Contenuto caricato -- Contenuto caricato
CREATE TABLE IF NOT EXISTS "uploaded_contents"( CREATE TABLE IF NOT EXISTS "uploads"(
"id" TEXT NOT NULL PRIMARY KEY, "id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL, "created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL, "owner_id" TEXT NOT NULL,
"dispensa_id" TEXT NOT NULL, "dispensa_id" TEXT NOT NULL,
"hash" TEXT NOT NULL "file" TEXT NOT NULL,
FOREIGN KEY (dispensa_id) REFERENCES dispense(id)
); );
-- Contenuti con hash approvati -- Contenuti con hash approvati
CREATE TABLE IF NOT EXISTS "hash_approvals"( CREATE TABLE IF NOT EXISTS "file_approvals"(
"id" TEXT NOT NULL PRIMARY KEY, "id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL, "created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL, "owner_id" TEXT NOT NULL, -- Moderatore che ha creato questa approvazione
"hash" TEXT NOT NULL "upload_id" TEXT NOT NULL, -- Upload a cui si riferisce questa approvazione
"status" TEXT NOT NULL, -- Risultato dell'approvazione: "approved" | "rejected"
FOREIGN KEY (upload_id) REFERENCES uploads(id)
); );
-- Contenuti con hash rifiutati -- Download counter
CREATE TABLE IF NOT EXISTS "hash_rejections"( CREATE TABLE IF NOT EXISTS "downloads"(
"id" TEXT NOT NULL PRIMARY KEY, "dispensa_id" TEXT NOT NULL,
"created_at" TEXT NOT NULL, "timestamp" TEXT NOT NULL,
"owner_id" TEXT NOT NULL, FOREIGN KEY (dispensa_id) REFERENCES dispense(id)
"hash" TEXT NOT NULL )
);
-- --
-- Relations -- Relations
@ -44,5 +46,6 @@ CREATE TABLE IF NOT EXISTS "hash_rejections"(
-- Tags per le dispense -- Tags per le dispense
CREATE TABLE IF NOT EXISTS "tags"( CREATE TABLE IF NOT EXISTS "tags"(
"dispensa_id" TEXT NOT NULL, "dispensa_id" TEXT NOT NULL,
"tags" TEXT NOT NULL "name" TEXT NOT NULL,
FOREIGN KEY (dispensa_id) REFERENCES dispense(id)
); );

Loading…
Cancel
Save