You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/database/migrations/0001-2022-08-31.sql

49 lines
1.1 KiB
SQL

--
-- Entities
--
-- Dispense
CREATE TABLE IF NOT EXISTS "dispense"(
"id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL
);
-- Contenuto caricato
CREATE TABLE IF NOT EXISTS "uploaded_contents"(
"id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL,
"dispensa_id" TEXT NOT NULL,
"hash" TEXT NOT NULL
);
-- Contenuti con hash approvati
CREATE TABLE IF NOT EXISTS "hash_approvals"(
"id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL,
"hash" TEXT NOT NULL
);
-- Contenuti con hash rifiutati
CREATE TABLE IF NOT EXISTS "hash_rejections"(
"id" TEXT NOT NULL PRIMARY KEY,
"created_at" TEXT NOT NULL,
"owner_id" TEXT NOT NULL,
"hash" TEXT NOT NULL
);
--
-- Relations
--
-- Tags per le dispense
CREATE TABLE IF NOT EXISTS "tags"(
"dispensa_id" TEXT NOT NULL,
"tags" TEXT NOT NULL
);