This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'search-test' of http://www.github.com/modrinth/labrinth …
…into search-test
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
CREATE TABLE loader_fields ( | ||
id serial PRIMARY KEY, | ||
loader_id integer REFERENCES loaders ON UPDATE CASCADE NOT NULL, | ||
field varchar(64) NOT NULL, | ||
field_type varchar(64) NOT NULL, | ||
enum_type integer REFERENCES loader_field_enums ON UPDATE CASCADE NULL, | ||
optional BOOLEAN NOT NULL DEFAULT true, | ||
-- for int- min/max val, for text- min len, for enum- min items, for bool- nth | ||
min_val integer NULL, | ||
max_val integer NULL | ||
); | ||
|
||
CREATE TABLE loader_field_enums ( | ||
id serial PRIMARY KEY, | ||
enum_name varchar(64) NOT NULL, | ||
ordering int NULL, | ||
hidable BOOLEAN NOT NULL DEFAULT FALSE, | ||
metadata | ||
); | ||
|
||
ALTER TABLE loaders ADD COLUMN hidable boolean NOT NULL default false; | ||
|
||
CREATE TABLE version_fields ( | ||
id serial PRIMARY KEY, | ||
version_id bigint REFERENCES versions ON UPDATE CASCADE NOT NULL, | ||
field_id integer REFERENCES loader_fields ON UPDATE CASCADE NOT NULL, | ||
-- for int/bool values | ||
int_value integer NULL, | ||
enum_value integer REFERENCES loader_field_enums ON UPDATE CASCADE NULL, | ||
string_value text NULL | ||
); |