forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/map-issues
- Loading branch information
Showing
229 changed files
with
4,964 additions
and
1,842 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
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
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
function onUpdateDatabase() | ||
return false -- true = There are others migrations file | false = this is the last migration file | ||
logger.info("Updating database to version 45 (fix: mana shield column size for more than 65k)") | ||
|
||
db.query([[ | ||
ALTER TABLE `players` | ||
MODIFY COLUMN `manashield` INT UNSIGNED NOT NULL DEFAULT '0', | ||
MODIFY COLUMN `max_manashield` INT UNSIGNED NOT NULL DEFAULT '0'; | ||
]]) | ||
|
||
return true | ||
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,56 @@ | ||
function onUpdateDatabase() | ||
logger.info("Updating database to version 46 (feat: vip groups)") | ||
|
||
db.query([[ | ||
CREATE TABLE IF NOT EXISTS `account_vipgroups` ( | ||
`id` tinyint(3) UNSIGNED NOT NULL, | ||
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is', | ||
`name` varchar(128) NOT NULL, | ||
`customizable` BOOLEAN NOT NULL DEFAULT '1', | ||
CONSTRAINT `account_vipgroups_pk` PRIMARY KEY (`id`, `account_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
]]) | ||
|
||
db.query([[ | ||
CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (1, NEW.`id`, 'Enemies', 0); | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (2, NEW.`id`, 'Friends', 0); | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) VALUES (3, NEW.`id`, 'Trading Partner', 0); | ||
END; | ||
]]) | ||
|
||
db.query([[ | ||
CREATE TABLE IF NOT EXISTS `account_vipgrouplist` ( | ||
`account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose viplist entry it is', | ||
`player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry', | ||
`vipgroup_id` tinyint(3) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs', | ||
INDEX `account_id` (`account_id`), | ||
INDEX `player_id` (`player_id`), | ||
INDEX `vipgroup_id` (`vipgroup_id`), | ||
CONSTRAINT `account_vipgrouplist_unique` UNIQUE (`account_id`, `player_id`, `vipgroup_id`), | ||
CONSTRAINT `account_vipgrouplist_player_fk` | ||
FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | ||
ON DELETE CASCADE, | ||
CONSTRAINT `account_vipgrouplist_vipgroup_fk` | ||
FOREIGN KEY (`vipgroup_id`, `account_id`) REFERENCES `account_vipgroups` (`id`, `account_id`) | ||
ON DELETE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
]]) | ||
|
||
db.query([[ | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) | ||
SELECT 1, id, 'Friends', 0 FROM `accounts`; | ||
]]) | ||
|
||
db.query([[ | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) | ||
SELECT 2, id, 'Enemies', 0 FROM `accounts`; | ||
]]) | ||
|
||
db.query([[ | ||
INSERT INTO `account_vipgroups` (`id`, `account_id`, `name`, `customizable`) | ||
SELECT 3, id, 'Trading Partners', 0 FROM `accounts`; | ||
]]) | ||
|
||
return true | ||
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,3 @@ | ||
function onUpdateDatabase() | ||
return false -- true = There are others migrations file | false = this is the last migration file | ||
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
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.