-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
112 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
UPDATE protections | ||
SET flags = CASE | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) IS NOT NULL THEN | ||
JSON_SET(flags, '$.flags', JSON_ARRAY(JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')))) | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) IS NOT NULL THEN | ||
JSON_SET(flags, '$.flags', JSON_ARRAY(JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')), JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')))) | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) IS NOT NULL THEN | ||
JSON_SET(flags, '$.flags', JSON_ARRAY(JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')))) | ||
ELSE | ||
JSON_SET(flags, '$.flags', JSON_ARRAY()) | ||
END; |
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,6 @@ | ||
/** | ||
* Author: rellu | ||
* Created: 19.02.2023 | ||
*/ | ||
|
||
INSERT INTO `plugin_informations` (`CREATED`, `CREATEDBY`, `tab_header`, `tab_footer`, `motd_message`, `motd_players`, `db_version`) SELECT now(), 1, tab_header, tab_footer, motd_message, motd_players, 9 FROM `plugin_informations` where deletedby is null; |
6 changes: 6 additions & 0 deletions
6
src/main/resources/sqls/patches/v9/updateOldPluginInformation.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,6 @@ | ||
/** | ||
* Author: rellu | ||
* Created: 19.02.2023 | ||
*/ | ||
|
||
UPDATE `plugin_informations` SET `deleted` = now(), `deletedby` = 1 WHERE `plugin_informations`.`DELETEDBY` IS NULL and `db_version` <> 9 ; |
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,28 @@ | ||
UPDATE protections | ||
SET flags = JSON_SET( | ||
flags, | ||
'$.flags', | ||
JSON_ARRAY( | ||
CASE | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) = 'allowHopper' THEN 'ALLOW_HOPPER' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) = 'allowPublic' THEN 'ALLOW_PUBLIC' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) = 'allowRedstone' THEN 'ALLOW_REDSTONE' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) = 'autoClose' THEN 'AUTO_CLOSE' | ||
ELSE JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[0]')) | ||
END, | ||
CASE | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) = 'allowHopper' THEN 'ALLOW_HOPPER' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) = 'allowPublic' THEN 'ALLOW_PUBLIC' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) = 'allowRedstone' THEN 'ALLOW_REDSTONE' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) = 'autoClose' THEN 'AUTO_CLOSE' | ||
ELSE JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[1]')) | ||
END, | ||
CASE | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[2]')) = 'allowHopper' THEN 'ALLOW_HOPPER' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[2]')) = 'allowPublic' THEN 'ALLOW_PUBLIC' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[2]')) = 'allowRedstone' THEN 'ALLOW_REDSTONE' | ||
WHEN JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[2]')) = 'autoClose' THEN 'AUTO_CLOSE' | ||
ELSE JSON_UNQUOTE(JSON_EXTRACT(flags, '$.flags[2]')) | ||
END | ||
) | ||
); |