new version commit

This commit is contained in:
mikx
2025-09-29 02:27:58 -04:00
commit 3e8d31e686
9244 changed files with 7357899 additions and 0 deletions

View File

View File

@@ -0,0 +1,3 @@
-- DB update 2023_09_16_00 -> 2024_01_20_00
--
DELETE FROM `updates` WHERE `state` = 'ARCHIVED';

View File

@@ -0,0 +1,5 @@
-- DB update 2024_01_20_00 -> 2024_07_05_00
--
ALTER TABLE `character_homebind`
DROP COLUMN `posO`;

View File

@@ -0,0 +1,15 @@
-- DB update 2024_07_05_00 -> 2024_09_03_00
DROP TABLE IF EXISTS `character_achievement_offline_updates`;
CREATE TABLE `character_achievement_offline_updates` (
`guid` INT UNSIGNED NOT NULL COMMENT 'Character\'s GUID',
`update_type` TINYINT UNSIGNED NOT NULL COMMENT 'Supported types: 1 - COMPLETE_ACHIEVEMENT; 2 - UPDATE_CRITERIA',
`arg1` INT UNSIGNED NOT NULL COMMENT 'For type 1: achievement ID; for type 2: ACHIEVEMENT_CRITERIA_TYPE',
`arg2` INT UNSIGNED DEFAULT NULL COMMENT 'For type 2: miscValue1 for updating achievement criteria',
`arg3` INT UNSIGNED DEFAULT NULL COMMENT 'For type 2: miscValue2 for updating achievement criteria',
INDEX `idx_guid` (`guid`)
)
COMMENT = 'Stores updates to character achievements when the character was offline'
CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci
ENGINE = InnoDB
;

View File

@@ -0,0 +1,4 @@
-- DB update 2024_09_03_00 -> 2024_09_22_00
--
ALTER TABLE `recovery_item`
ADD COLUMN `DeleteDate` INT UNSIGNED NULL DEFAULT NULL AFTER `Count`;

View File

@@ -0,0 +1,4 @@
-- DB update 2024_09_22_00 -> 2024_11_15_00
UPDATE `updates`
SET `state` = 'ARCHIVED'
WHERE `name` LIKE '2023_%';

View File

@@ -0,0 +1,13 @@
-- DB update 2024_11_15_00 -> 2025_01_31_00
--
DROP TABLE IF EXISTS `world_state`;
CREATE TABLE IF NOT EXISTS `world_state` (
`Id` INT UNSIGNED NOT NULL COMMENT 'Internal save ID',
`Data` longtext,
PRIMARY KEY(`Id`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4 COMMENT='WorldState save system';
-- Isle of Quel'danas is in its final stage with all subphases completed
-- open all Sunwell Plateau gates
DELETE FROM `world_state` WHERE `Id` = 20;
INSERT INTO `world_state` (`Id`, `Data`) VALUES(20, '3 15 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 3 80 80 80');

View File

@@ -0,0 +1,11 @@
-- DB update 2025_01_31_00 -> 2025_02_12_00
DROP TABLE IF EXISTS `active_arena_season`;
CREATE TABLE `active_arena_season` (
`season_id` TINYINT UNSIGNED NOT NULL,
`season_state` TINYINT UNSIGNED NOT NULL COMMENT 'Supported 2 states: 0 - disabled; 1 - in progress.'
)
CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci
ENGINE = InnoDB;
INSERT INTO `active_arena_season` (`season_id`, `season_state`) VALUES (8, 1);

View File

@@ -0,0 +1,11 @@
-- DB update 2025_02_12_00 -> 2025_02_16_00
--
ALTER TABLE `updates`
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
ALTER TABLE `updates_include`
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_characters';
INSERT INTO `updates_include` (`path`, `state`) VALUES
('$/data/sql/updates/pending_db_characters', 'PENDING');

View File

@@ -0,0 +1,66 @@
-- DB update 2025_02_16_00 -> 2025_03_09_00
--
DROP TABLE IF EXISTS `mail_server_template_items`;
CREATE TABLE `mail_server_template_items` (
`id` INT UNSIGNED AUTO_INCREMENT,
`templateID` INT UNSIGNED NOT NULL,
`faction` ENUM('Alliance', 'Horde') NOT NULL,
`item` INT UNSIGNED NOT NULL,
`itemCount` INT UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_mail_template`
FOREIGN KEY (`templateID`) REFERENCES `mail_server_template`(`id`)
ON DELETE CASCADE
) ENGINE=InnoDB COLLATE='utf8mb4_unicode_ci';
DELETE FROM `mail_server_template_items` WHERE `faction` = 'Alliance';
INSERT INTO `mail_server_template_items` (`templateID`, `faction`, `item`, `itemCount`)
SELECT `id`, 'Alliance', `itemA`, `itemCountA` FROM `mail_server_template` WHERE `itemA` > 0;
DELETE FROM `mail_server_template_items` WHERE `faction` = 'Horde';
INSERT INTO `mail_server_template_items` (`templateID`, `faction`, `item`, `itemCount`)
SELECT `id`, 'Horde', `itemH`, `itemCountH` FROM `mail_server_template` WHERE `itemH` > 0;
ALTER TABLE `mail_server_template`
DROP COLUMN `itemA`,
DROP COLUMN `itemCountA`,
DROP COLUMN `itemH`,
DROP COLUMN `itemCountH`;
-- mail_server_template_conditions
DROP TABLE IF EXISTS `mail_server_template_conditions`;
CREATE TABLE `mail_server_template_conditions` (
`id` INT UNSIGNED AUTO_INCREMENT,
`templateID` INT UNSIGNED NOT NULL,
`conditionType` ENUM('Level', 'PlayTime', 'Quest', 'Achievement', 'Reputation', 'Faction', 'Race', 'Class') NOT NULL,
`conditionValue` INT UNSIGNED NOT NULL,
`conditionState` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
CONSTRAINT `fk_mail_template_conditions`
FOREIGN KEY (`templateID`) REFERENCES `mail_server_template`(`id`)
ON DELETE CASCADE
) ENGINE=InnoDB COLLATE='utf8mb4_unicode_ci';
DELETE FROM `mail_server_template_conditions` WHERE `conditionType` = 'Level';
INSERT INTO `mail_server_template_conditions` (`templateID`, `conditionType`, `conditionValue`)
SELECT `id`, 'Level', `reqLevel` FROM `mail_server_template` WHERE `reqLevel` > 0;
DELETE FROM `mail_server_template_conditions` WHERE `conditionType` = 'PlayTime';
INSERT INTO `mail_server_template_conditions` (`templateID`, `conditionType`, `conditionValue`)
SELECT `id`, 'PlayTime', `reqPlayTime` FROM `mail_server_template` WHERE `reqPlayTime` > 0;
ALTER TABLE `mail_server_template`
DROP COLUMN `reqLevel`,
DROP COLUMN `reqPlayTime`;
-- mail_server_character
-- Make sure we dont have invalid instances in mail_server_character.mailId before we add the foregin key to avoid SQL errors
DELETE FROM `mail_server_character` WHERE `mailId` NOT IN (SELECT `id` FROM `mail_server_template`);
-- Add foreign key for mail_server_character.mailId
ALTER TABLE `mail_server_character`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`guid`, `mailId`),
ADD CONSTRAINT `fk_mail_server_character`
FOREIGN KEY (`mailId`) REFERENCES `mail_server_template`(`id`)
ON DELETE CASCADE;

View File

@@ -0,0 +1,3 @@
-- DB update 2025_03_09_00 -> 2025_07_11_00
--
ALTER TABLE `world_state` ENGINE = InnoDB;

View File

@@ -0,0 +1,4 @@
-- DB update 2025_07_11_00 -> 2025_07_29_00
--
ALTER TABLE `mail_server_template_conditions`
CHANGE COLUMN `conditionType` `conditionType` ENUM('Level','PlayTime','Quest','Achievement','Reputation','Faction','Race','Class','AccountFlags') NOT NULL COLLATE 'utf8mb4_unicode_ci' AFTER `templateID`;

View File

@@ -0,0 +1,15 @@
-- DB update 2025_07_29_00 -> 2025_09_03_00
-- Add petition_id column to petition table
ALTER TABLE `petition` ADD COLUMN `petition_id` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `petitionguid`;
-- Populate petition_id based on petitionguid
UPDATE `petition` SET `petition_id` = CASE WHEN `petitionguid` <= 2147483647 THEN `petitionguid` ELSE `petitionguid` - 2147483648 END WHERE `petition_id` = 0;
-- Add index on petition_id
ALTER TABLE `petition` ADD INDEX `idx_petition_id` (`petition_id`);
-- Add petition_id column to petition_sign table
ALTER TABLE `petition_sign` ADD COLUMN `petition_id` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `petitionguid`;
-- Populate petition_id in petition_sign from petition table
UPDATE `petition_sign` AS `ps` JOIN `petition` AS `p` ON `p`.`petitionguid` = `ps`.`petitionguid` SET `ps`.`petition_id` = `p`.`petition_id` WHERE `ps`.`petition_id` = 0;
-- Add index on petition_id and playerguid in petition_sign
ALTER TABLE `petition_sign` ADD INDEX `idx_petition_id_player` (`petition_id`, `playerguid`);
-- Update enchantments in item_instance with petition_id prefix
UPDATE `item_instance` AS `ii` JOIN `petition` AS `p` ON `p`.`petitionguid` = `ii`.`guid` SET `ii`.`enchantments` = CONCAT(`p`.`petition_id`, SUBSTRING(`ii`.`enchantments`, LOCATE(' ', `ii`.`enchantments`))) WHERE `ii`.`enchantments` IS NOT NULL AND `ii`.`enchantments` <> '';