summaryrefslogtreecommitdiff
path: root/src/db/migrations/0000.sql
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-04-05 10:46:09 -0400
committerFreya Murphy <freya@freyacat.org>2024-04-05 10:46:09 -0400
commit530bbf058781e00e588f1457b6ee589a64b74da1 (patch)
treec6cdd382a86d55538686293e51a1fc056cb59029 /src/db/migrations/0000.sql
parentremove var (diff)
downloadxssbook2-530bbf058781e00e588f1457b6ee589a64b74da1.tar.gz
xssbook2-530bbf058781e00e588f1457b6ee589a64b74da1.tar.bz2
xssbook2-530bbf058781e00e588f1457b6ee589a64b74da1.zip
i did thing oh god large commit
Diffstat (limited to 'src/db/migrations/0000.sql')
-rw-r--r--src/db/migrations/0000.sql12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/db/migrations/0000.sql b/src/db/migrations/0000.sql
index 7e14ac4..aa20d2f 100644
--- a/src/db/migrations/0000.sql
+++ b/src/db/migrations/0000.sql
@@ -198,7 +198,7 @@ CREATE TABLE admin.media (
id INTEGER DEFAULT nextval('sys.media_id_seq'::regclass) NOT NULL,
name TEXT NOT NULL,
content BYTEA NOT NULL,
- type TEXT NOT NULL,
+ mime TEXT NOT NULL,
created TIMESTAMP WITH TIME ZONE DEFAULT clock_timestamp() NOT NULL,
modified TIMESTAMP WITH TIME ZONE DEFAULT clock_timestamp() NOT NULL
);
@@ -224,9 +224,12 @@ CREATE TYPE admin.user_media_type AS ENUM (
CREATE TABLE admin.user_media (
id INTEGER DEFAULT nextval('sys.user_media_id_seq'::regclass) NOT NULL,
- media_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
- type admin.user_media_type NOT NULL
+ content BYTEA NOT NULL,
+ mime TEXT NOT NULL,
+ type admin.user_media_type NOT NULL,
+ created TIMESTAMP WITH TIME ZONE DEFAULT clock_timestamp() NOT NULL,
+ modified TIMESTAMP WITH TIME ZONE DEFAULT clock_timestamp() NOT NULL
);
ALTER TABLE admin.user_media OWNER TO xssbook;
@@ -235,9 +238,6 @@ ALTER TABLE ONLY admin.user_media
ADD CONSTRAINT user_media_pkey PRIMARY KEY (id);
ALTER TABLE ONLY admin.user_media
- ADD CONSTRAINT user_media_media_id_fkey FOREIGN KEY (media_id) REFERENCES admin.media (id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY admin.user_media
ADD CONSTRAINT user_media_user_id_fkey FOREIGN KEY (user_id) REFERENCES admin.user (id) ON DELETE CASCADE;
ALTER TABLE ONLY admin.user_media