You've already forked AstralRinth
forked from didirus/AstralRinth
Collections (#688)
* initial draft; unfinished * images, fixes * fixes * println * revisions * fixes * alternate context setup version * rev * partial revs * rev * clippy ,fmt * fmt/clippy/prepare * fixes * revs
This commit is contained in:
37
migrations/20230816085700_collections_and_more.sql
Normal file
37
migrations/20230816085700_collections_and_more.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
CREATE TABLE collections (
|
||||
id bigint PRIMARY KEY,
|
||||
title varchar(255) NOT NULL,
|
||||
description varchar(2048) NOT NULL,
|
||||
user_id bigint REFERENCES users NOT NULL,
|
||||
created timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
status varchar(64) NOT NULL DEFAULT 'listed',
|
||||
|
||||
icon_url varchar(2048) NULL,
|
||||
color integer NULL
|
||||
);
|
||||
|
||||
CREATE TABLE collections_mods (
|
||||
collection_id bigint REFERENCES collections NOT NULL,
|
||||
mod_id bigint REFERENCES mods NOT NULL,
|
||||
PRIMARY KEY (collection_id, mod_id)
|
||||
);
|
||||
|
||||
CREATE TABLE uploaded_images (
|
||||
id bigint PRIMARY KEY,
|
||||
url varchar(2048) NOT NULL,
|
||||
size integer NOT NULL,
|
||||
created timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
owner_id bigint REFERENCES users NOT NULL,
|
||||
|
||||
-- Type of contextual association
|
||||
context varchar(64) NOT NULL, -- project, version, thread_message, report, etc.
|
||||
|
||||
-- Only one of these should be set (based on 'context')
|
||||
mod_id bigint NULL REFERENCES mods,
|
||||
version_id bigint NULL REFERENCES versions,
|
||||
thread_message_id bigint NULL REFERENCES threads_messages,
|
||||
report_id bigint NULL REFERENCES reports
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user