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 'master' into payouts-code
- Loading branch information
Showing
58 changed files
with
7,795 additions
and
6,716 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
.sqlx/query-2efd0efe9ce16b2da01d9bcc1603e3a7ad0f9a1e5a457770608bc41dbb83f2dd.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
.sqlx/query-a796587302ae98d1af5f41696e401174fbeb9e8399bdcc78ffe8f80181b217a4.json
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
.sqlx/query-cdb2f18f826097f0f17a1f7295d7c45eb1987b63c1a21666c6ca60c52217ba4d.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,46 @@ | ||
ALTER TABLE loaders ADD COLUMN metadata jsonb NOT NULL DEFAULT '{}'::jsonb; | ||
|
||
-- Set 'platform' to 'true' for all plugin loaders | ||
-- From knossos v2 | ||
-- pluginLoaders: ['bukkit', 'spigot', 'paper', 'purpur', 'sponge', 'folia'], | ||
-- pluginPlatformLoaders: ['bungeecord', 'waterfall', 'velocity'], | ||
-- allPluginLoaders: [ | ||
-- 'bukkit', | ||
-- 'spigot', | ||
-- 'paper', | ||
-- 'purpur', | ||
-- 'sponge', | ||
-- 'bungeecord', | ||
-- 'waterfall', | ||
-- 'velocity', | ||
-- 'folia', | ||
-- ], | ||
-- dataPackLoaders: ['datapack'], | ||
-- modLoaders: ['forge', 'fabric', 'quilt', 'liteloader', 'modloader', 'rift', 'neoforge'], | ||
UPDATE loaders SET metadata = jsonb_set(metadata, '{platform}', 'false'::jsonb) WHERE loader in ('bukkit', 'spigot', 'paper', 'purpur', 'sponge', 'folia'); | ||
UPDATE loaders SET metadata = jsonb_set(metadata, '{platform}', 'true'::jsonb) WHERE loader in ('bungeecord', 'waterfall', 'velocity'); | ||
|
||
INSERT INTO project_types (name) VALUES ('plugin'); | ||
INSERT INTO project_types (name) VALUES ('datapack'); | ||
|
||
INSERT INTO loaders_project_types (joining_loader_id, joining_project_type_id) | ||
SELECT l.id, pt.id | ||
FROM loaders l | ||
CROSS JOIN project_types pt | ||
WHERE l.loader in ('datapack') | ||
AND pt.name = 'datapack'; | ||
|
||
INSERT INTO loaders_project_types (joining_loader_id, joining_project_type_id) | ||
SELECT l.id, pt.id | ||
FROM loaders l | ||
CROSS JOIN project_types pt | ||
WHERE l.loader in ('bukkit', 'spigot', 'paper', 'purpur', 'sponge', 'bungeecord', 'waterfall', 'velocity', 'folia') | ||
AND pt.name = 'plugin'; | ||
|
||
INSERT INTO loaders_project_types_games (loader_id, project_type_id, game_id) | ||
SELECT joining_loader_id, joining_project_type_id, g.id | ||
FROM loaders_project_types lpt | ||
INNER JOIN project_types pt ON pt.id = lpt.joining_project_type_id | ||
CROSS JOIN games g | ||
WHERE g.name = 'minecraft' | ||
AND pt.name in ('plugin', 'datapack'); |
45 changes: 45 additions & 0 deletions
45
migrations/20231122111700_adds_missing_loader_field_loaders.sql
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,45 @@ | ||
|
||
-- Adds missing fields to loader_fields_loaders | ||
INSERT INTO loader_fields_loaders (loader_id, loader_field_id) | ||
SELECT l.id, lf.id FROM loaders l CROSS JOIN loader_fields lf WHERE lf.field = 'game_versions' | ||
AND l.loader = ANY( ARRAY['forge', 'fabric', 'quilt', 'modloader','rift','liteloader', 'neoforge']) | ||
ON CONFLICT (loader_id, loader_field_id) DO NOTHING; | ||
|
||
-- Fixes mrpack variants being added to the wrong enum | ||
-- Luckily, mrpack variants are the only ones set to 2 without metadata | ||
UPDATE loader_field_enum_values SET enum_id = 3 WHERE enum_id = 2 AND metadata IS NULL; | ||
|
||
-- Because it was mislabeled, version_fields for mrpack_loaders were set to null. | ||
-- 1) Update version_fields corresponding to mrpack_loaders to the correct enum_value | ||
UPDATE version_fields vf | ||
SET enum_value = subquery.lfev_id | ||
FROM ( | ||
SELECT vf.version_id, vf.field_id, lfev.id AS lfev_id | ||
FROM version_fields vf | ||
LEFT JOIN versions v ON v.id = vf.version_id | ||
LEFT JOIN loaders_versions lv ON v.id = lv.version_id | ||
LEFT JOIN loaders l ON l.id = lv.loader_id | ||
LEFT JOIN loader_fields lf ON lf.id = vf.field_id | ||
LEFT JOIN loader_field_enum_values lfev ON lfev.value = l.loader AND lf.enum_type = lfev.enum_id | ||
WHERE lf.field = 'mrpack_loaders' AND vf.enum_value IS NULL | ||
) AS subquery | ||
WHERE vf.version_id = subquery.version_id AND vf.field_id = subquery.field_id; | ||
|
||
-- 2) Set those versions to mrpack as their version | ||
INSERT INTO loaders_versions (version_id, loader_id) | ||
SELECT DISTINCT vf.version_id, l.id | ||
FROM version_fields vf | ||
LEFT JOIN loader_fields lf ON lf.id = vf.field_id | ||
CROSS JOIN loaders l | ||
WHERE lf.field = 'mrpack_loaders' | ||
AND l.loader = 'mrpack' | ||
ON CONFLICT DO NOTHING; | ||
|
||
-- 3) Delete the old versions that had mrpack added to them | ||
DELETE FROM loaders_versions lv | ||
WHERE lv.loader_id != (SELECT id FROM loaders WHERE loader = 'mrpack') | ||
AND lv.version_id IN ( | ||
SELECT version_id | ||
FROM loaders_versions | ||
WHERE loader_id = (SELECT id FROM loaders WHERE loader = 'mrpack') | ||
); |
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
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
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
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
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
Oops, something went wrong.