From f9416c549d120b39c2f6a7b85ca8019a52344c01 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 21 Mar 2017 23:09:55 +0100 Subject: [PATCH] Updates/SQL * noticed having comments inside querys in these files breaks them * also there appear to be files with \r line endings left --- .gitattributes | 1 - setup/updates/1433023200_01.sql | 26 +- setup/updates/1433023200_02.sql | 4 +- setup/updates/1433793600_01.sql | 158 ++++---- setup/updates/1435777200_01.sql | 4 +- setup/updates/1436392800_01.sql | 30 +- setup/updates/1436619600_01.sql | 10 +- setup/updates/1436634000_01.sql | 2 +- setup/updates/1436634000_02.sql | 116 +++--- setup/updates/1436735830_01.sql | 104 ++--- setup/updates/1436739821_01.sql | 2 +- setup/updates/1436903207_01.sql | 8 +- setup/updates/1437329787_01.sql | 30 +- setup/updates/1437430574_01.sql | 62 +-- setup/updates/1437472069_01.sql | 4 +- setup/updates/1438620486_01.sql | 136 +++---- setup/updates/1438715648_01.sql | 46 +-- setup/updates/1438878038_01.sql | 106 ++--- setup/updates/1438970456_01.sql | 6 +- setup/updates/1439297934_01.sql | 30 +- setup/updates/1439469082_01.sql | 2 +- setup/updates/1439590146_01.sql | 14 +- setup/updates/1439840492_01.sql | 2 +- setup/updates/1439909965_01.sql | 2 +- setup/updates/1439924313_01.sql | 1 - setup/updates/1445293761_01.sql | 4 +- setup/updates/1446293928_01.sql | 206 +++++----- setup/updates/1446917082_01.sql | 6 +- setup/updates/1448204650_01.sql | 6 +- setup/updates/1448727750_01.sql | 2 +- setup/updates/1452718627_01.sql | 2 +- setup/updates/1456585695_01.sql | 698 ++++++++++++++++---------------- setup/updates/1484926142_01.sql | 16 +- setup/updates/1486948902_01.sql | 2 +- setup/updates/1488061468_01.sql | 2 +- setup/updates/1489291710_01.sql | 4 +- setup/updates/1489942886_01.sql | 4 +- 37 files changed, 926 insertions(+), 932 deletions(-) diff --git a/.gitattributes b/.gitattributes index 91362a8e..6f5933e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,3 @@ *.js text eol=lf *.css text eol=lf *.sql text eol=lf - diff --git a/setup/updates/1433023200_01.sql b/setup/updates/1433023200_01.sql index 661f1804..919c0c0e 100644 --- a/setup/updates/1433023200_01.sql +++ b/setup/updates/1433023200_01.sql @@ -1,13 +1,13 @@ -ALTER TABLE `aowow_creature` - ADD INDEX `difficultyEntry1` (`difficultyEntry1`), - ADD INDEX `difficultyEntry2` (`difficultyEntry2`), - ADD INDEX `difficultyEntry3` (`difficultyEntry3`); - -UPDATE aowow_items i, aowow_spell s SET i.class = 0, i.subClass = 6 WHERE s.Id = i.spellId1 AND s.effect1Id = 53 AND i.classBak = 12; -UPDATE aowow_items SET class = 12 WHERE classBak = 15 AND startQuest <> 0 AND name_loc0 NOT LIKE "sayge\'s fortune%"; -UPDATE aowow_items SET subClass = 3 WHERE classBak = 15 AND subClassBak = 0 AND holidayId <> 0; -UPDATE aowow_items SET subClass = 11 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 773; -UPDATE aowow_items SET subClass = 9 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 356; -UPDATE aowow_items SET subClass = 12 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 186; -UPDATE aowow_items SET subClass = 5 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 185; -UPDATE aowow_items SET subClass = 6 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 171; +ALTER TABLE `aowow_creature` + ADD INDEX `difficultyEntry1` (`difficultyEntry1`), + ADD INDEX `difficultyEntry2` (`difficultyEntry2`), + ADD INDEX `difficultyEntry3` (`difficultyEntry3`); + +UPDATE aowow_items i, aowow_spell s SET i.class = 0, i.subClass = 6 WHERE s.Id = i.spellId1 AND s.effect1Id = 53 AND i.classBak = 12; +UPDATE aowow_items SET class = 12 WHERE classBak = 15 AND startQuest <> 0 AND name_loc0 NOT LIKE "sayge\'s fortune%"; +UPDATE aowow_items SET subClass = 3 WHERE classBak = 15 AND subClassBak = 0 AND holidayId <> 0; +UPDATE aowow_items SET subClass = 11 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 773; +UPDATE aowow_items SET subClass = 9 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 356; +UPDATE aowow_items SET subClass = 12 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 186; +UPDATE aowow_items SET subClass = 5 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 185; +UPDATE aowow_items SET subClass = 6 WHERE classBak = 9 AND subClassBak = 0 AND requiredSkill = 171; diff --git a/setup/updates/1433023200_02.sql b/setup/updates/1433023200_02.sql index 17bd2497..0bb36803 100644 --- a/setup/updates/1433023200_02.sql +++ b/setup/updates/1433023200_02.sql @@ -1,2 +1,2 @@ -UPDATE aowow_zones SET mapId = 1 WHERE id IN (14,15,16,17,141,148,215,331,332,357,361,377,400,405,406,440,457,490,493,616,618,876,1377,1637,1638,1657,1941,2159,2917,3478,3524,3525,3557); -UPDATE aowow_zones SET mapId = 1 WHERE parentArea IN (14,15,16,17,141,148,215,331,332,357,361,377,400,405,406,440,457,490,493,616,618,876,1377,1637,1638,1657,1941,2159,2917,3478,3524,3525,3557); +UPDATE aowow_zones SET mapId = 1 WHERE id IN (14,15,16,17,141,148,215,331,332,357,361,377,400,405,406,440,457,490,493,616,618,876,1377,1637,1638,1657,1941,2159,2917,3478,3524,3525,3557); +UPDATE aowow_zones SET mapId = 1 WHERE parentArea IN (14,15,16,17,141,148,215,331,332,357,361,377,400,405,406,440,457,490,493,616,618,876,1377,1637,1638,1657,1941,2159,2917,3478,3524,3525,3557); diff --git a/setup/updates/1433793600_01.sql b/setup/updates/1433793600_01.sql index eb2cf7d8..be8923eb 100644 --- a/setup/updates/1433793600_01.sql +++ b/setup/updates/1433793600_01.sql @@ -1,79 +1,79 @@ --- *************************** --- * change engine to InnoDB * --- * unify userId-fields * --- *************************** - -ALTER TABLE `aowow_account` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT; - -ALTER TABLE `aowow_account_banned` - ALTER `userId` DROP DEFAULT, - ALTER `staffId` DROP DEFAULT; -ALTER TABLE `aowow_account_banned` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT, - CHANGE COLUMN `userId` `userId` INT(10) UNSIGNED NOT NULL COMMENT 'affected accountId' AFTER `id`, - CHANGE COLUMN `staffId` `staffId` INT(10) UNSIGNED NOT NULL COMMENT 'executive accountId' AFTER `userId`; - -ALTER TABLE `aowow_account_cookies` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT; - -ALTER TABLE `aowow_account_reputation` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT; - -ALTER TABLE `aowow_account_weightscales` - ALTER `account` DROP DEFAULT; -ALTER TABLE `aowow_account_weightscales` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT, - CHANGE COLUMN `account` `userId` INT(10) UNSIGNED NOT NULL AFTER `id`; - -ALTER TABLE `aowow_screenshots` - ALTER `uploader` DROP DEFAULT; -ALTER TABLE `aowow_screenshots` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT, - CHANGE COLUMN `uploader` `userIdOwner` INT(10) UNSIGNED NULL AFTER `typeId`, - CHANGE COLUMN `approvedBy` `userIdApprove` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `status`, - CHANGE COLUMN `deletedBy` `userIdDelete` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `userIdApprove`; - -ALTER TABLE `aowow_videos` - ALTER `uploader` DROP DEFAULT; -ALTER TABLE `aowow_videos` - ENGINE=InnoDB, - ROW_FORMAT=COMPACT, - CHANGE COLUMN `uploader` `userIdOwner` INT(10) UNSIGNED NULL AFTER `typeId`, - CHANGE COLUMN `approvedBy` `userIdApprove` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `status`, - ADD COLUMN `userIdeDelete` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `userIdApprove`; - --- ********************** --- * apply foreign keys * --- ********************** - -ALTER TABLE aowow_account_cookies ADD CONSTRAINT FK_acc_cookies FOREIGN KEY (userId) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE CASCADE -; -ALTER TABLE aowow_account_banned ADD CONSTRAINT FK_acc_banned FOREIGN KEY (userId) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE CASCADE -; -ALTER TABLE aowow_account_reputation ADD CONSTRAINT FK_acc_rep FOREIGN KEY (userId) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE CASCADE -; -ALTER TABLE aowow_account_weightscales ADD CONSTRAINT FK_acc_weights FOREIGN KEY (userId) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE CASCADE -; -ALTER TABLE aowow_screenshots ADD CONSTRAINT FK_acc_ss FOREIGN KEY (userIdOwner) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE SET NULL -; -ALTER TABLE aowow_videos ADD CONSTRAINT FK_acc_vi FOREIGN KEY (userIdOwner) REFERENCES aowow_account(id) - ON UPDATE CASCADE - ON DELETE SET NULL -; +-- *************************** +-- * change engine to InnoDB * +-- * unify userId-fields * +-- *************************** + +ALTER TABLE `aowow_account` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT; + +ALTER TABLE `aowow_account_banned` + ALTER `userId` DROP DEFAULT, + ALTER `staffId` DROP DEFAULT; +ALTER TABLE `aowow_account_banned` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT, + CHANGE COLUMN `userId` `userId` INT(10) UNSIGNED NOT NULL COMMENT 'affected accountId' AFTER `id`, + CHANGE COLUMN `staffId` `staffId` INT(10) UNSIGNED NOT NULL COMMENT 'executive accountId' AFTER `userId`; + +ALTER TABLE `aowow_account_cookies` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT; + +ALTER TABLE `aowow_account_reputation` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT; + +ALTER TABLE `aowow_account_weightscales` + ALTER `account` DROP DEFAULT; +ALTER TABLE `aowow_account_weightscales` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT, + CHANGE COLUMN `account` `userId` INT(10) UNSIGNED NOT NULL AFTER `id`; + +ALTER TABLE `aowow_screenshots` + ALTER `uploader` DROP DEFAULT; +ALTER TABLE `aowow_screenshots` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT, + CHANGE COLUMN `uploader` `userIdOwner` INT(10) UNSIGNED NULL AFTER `typeId`, + CHANGE COLUMN `approvedBy` `userIdApprove` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `status`, + CHANGE COLUMN `deletedBy` `userIdDelete` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `userIdApprove`; + +ALTER TABLE `aowow_videos` + ALTER `uploader` DROP DEFAULT; +ALTER TABLE `aowow_videos` + ENGINE=InnoDB, + ROW_FORMAT=COMPACT, + CHANGE COLUMN `uploader` `userIdOwner` INT(10) UNSIGNED NULL AFTER `typeId`, + CHANGE COLUMN `approvedBy` `userIdApprove` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `status`, + ADD COLUMN `userIdeDelete` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `userIdApprove`; + +-- ********************** +-- * apply foreign keys * +-- ********************** + +ALTER TABLE aowow_account_cookies ADD CONSTRAINT FK_acc_cookies FOREIGN KEY (userId) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE CASCADE +; +ALTER TABLE aowow_account_banned ADD CONSTRAINT FK_acc_banned FOREIGN KEY (userId) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE CASCADE +; +ALTER TABLE aowow_account_reputation ADD CONSTRAINT FK_acc_rep FOREIGN KEY (userId) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE CASCADE +; +ALTER TABLE aowow_account_weightscales ADD CONSTRAINT FK_acc_weights FOREIGN KEY (userId) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE CASCADE +; +ALTER TABLE aowow_screenshots ADD CONSTRAINT FK_acc_ss FOREIGN KEY (userIdOwner) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE SET NULL +; +ALTER TABLE aowow_videos ADD CONSTRAINT FK_acc_vi FOREIGN KEY (userIdOwner) REFERENCES aowow_account(id) + ON UPDATE CASCADE + ON DELETE SET NULL +; diff --git a/setup/updates/1435777200_01.sql b/setup/updates/1435777200_01.sql index d83e66cd..5daeac84 100644 --- a/setup/updates/1435777200_01.sql +++ b/setup/updates/1435777200_01.sql @@ -1,2 +1,2 @@ -INSERT IGNORE INTO aowow_config (`key`, `value`, `flags`, `comment`) VALUES - ('memory_limit', '2048M', 0xC8, 'default: 2048M - parsing spell.dbc is quite intense'); +INSERT IGNORE INTO aowow_config (`key`, `value`, `flags`, `comment`) VALUES + ('memory_limit', '2048M', 0xC8, 'default: 2048M - parsing spell.dbc is quite intense'); diff --git a/setup/updates/1436392800_01.sql b/setup/updates/1436392800_01.sql index 9e912077..52aa21d5 100644 --- a/setup/updates/1436392800_01.sql +++ b/setup/updates/1436392800_01.sql @@ -1,15 +1,15 @@ -ALTER TABLE `aowow_config` - ADD COLUMN `cat` TINYINT(3) UNSIGNED NOT NULL DEFAULT '5' AFTER `value`; - -INSERT IGNORE INTO `aowow_config` (`key`, `value`, `cat`, `flags`, `comment`) VALUES - ('cache_dir', '', 1, 136, 'default: cache/template - generated pages are saved here (requires CACHE_MODE: filecache)'), - ('session.gc_maxlifetime', '604800', 3, 200, 'default: 7*24*60*60 - lifetime of session data'), - ('session.gc_probability', '0', 3, 200, 'default: 0 - probability to remove session data on garbage collection'), - ('session_cache_dir', '', 3, 136, 'default: - php sessions are saved here. Leave empty to use php default directory.'); - -UPDATE `aowow_config` SET `key` = 'acc_failed_auth_block' WHERE `key` = 'failed_auth_exclusion'; -UPDATE `aowow_config` SET `key` = 'acc_failed_auth_count' WHERE `key` = 'failed_auth_count'; -UPDATE `aowow_config` SET `key` = 'acc_allow_register' WHERE `key` = 'allow_register'; -UPDATE `aowow_config` SET `key` = 'acc_auth_mode' WHERE `key` = 'auth_mode'; -UPDATE `aowow_config` SET `key` = 'acc_create_save_decay' WHERE `key` = 'account_create_save_decay'; -UPDATE `aowow_config` SET `key` = 'acc_recovery_decay' WHERE `key` = 'account_recovery_decay'; +ALTER TABLE `aowow_config` + ADD COLUMN `cat` TINYINT(3) UNSIGNED NOT NULL DEFAULT '5' AFTER `value`; + +INSERT IGNORE INTO `aowow_config` (`key`, `value`, `cat`, `flags`, `comment`) VALUES + ('cache_dir', '', 1, 136, 'default: cache/template - generated pages are saved here (requires CACHE_MODE: filecache)'), + ('session.gc_maxlifetime', '604800', 3, 200, 'default: 7*24*60*60 - lifetime of session data'), + ('session.gc_probability', '0', 3, 200, 'default: 0 - probability to remove session data on garbage collection'), + ('session_cache_dir', '', 3, 136, 'default: - php sessions are saved here. Leave empty to use php default directory.'); + +UPDATE `aowow_config` SET `key` = 'acc_failed_auth_block' WHERE `key` = 'failed_auth_exclusion'; +UPDATE `aowow_config` SET `key` = 'acc_failed_auth_count' WHERE `key` = 'failed_auth_count'; +UPDATE `aowow_config` SET `key` = 'acc_allow_register' WHERE `key` = 'allow_register'; +UPDATE `aowow_config` SET `key` = 'acc_auth_mode' WHERE `key` = 'auth_mode'; +UPDATE `aowow_config` SET `key` = 'acc_create_save_decay' WHERE `key` = 'account_create_save_decay'; +UPDATE `aowow_config` SET `key` = 'acc_recovery_decay' WHERE `key` = 'account_recovery_decay'; diff --git a/setup/updates/1436619600_01.sql b/setup/updates/1436619600_01.sql index 1dca8932..eda6b3c0 100644 --- a/setup/updates/1436619600_01.sql +++ b/setup/updates/1436619600_01.sql @@ -1,5 +1,5 @@ -ALTER TABLE `aowow_currencies` - ADD COLUMN `cap` MEDIUMINT UNSIGNED NOT NULL AFTER `itemId`; - -UPDATE `aowow_currencies` SET `cap` = 10000 WHERE `id` = 103; -UPDATE `aowow_currencies` SET `cap` = 75000 WHERE `id` = 104; +ALTER TABLE `aowow_currencies` + ADD COLUMN `cap` MEDIUMINT UNSIGNED NOT NULL AFTER `itemId`; + +UPDATE `aowow_currencies` SET `cap` = 10000 WHERE `id` = 103; +UPDATE `aowow_currencies` SET `cap` = 75000 WHERE `id` = 104; diff --git a/setup/updates/1436634000_01.sql b/setup/updates/1436634000_01.sql index db88b9c0..026eafb9 100644 --- a/setup/updates/1436634000_01.sql +++ b/setup/updates/1436634000_01.sql @@ -1 +1 @@ -INSERT IGNORE INTO `aowow_config` (`key`, `value`, `flags`, `comment`) VALUES ('default_charset', 'UTF-8', 72, 'default: UTF-8'); +INSERT IGNORE INTO `aowow_config` (`key`, `value`, `flags`, `comment`) VALUES ('default_charset', 'UTF-8', 72, 'default: UTF-8'); diff --git a/setup/updates/1436634000_02.sql b/setup/updates/1436634000_02.sql index d6432249..de2a7ae3 100644 --- a/setup/updates/1436634000_02.sql +++ b/setup/updates/1436634000_02.sql @@ -1,58 +1,58 @@ -ALTER TABLE `aowow_items` - ALTER `holidayId` DROP DEFAULT; -ALTER TABLE `aowow_items` - CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `itemLimitCategory`; - -ALTER TABLE `aowow_itemset` - ALTER `holidayId` DROP DEFAULT; -ALTER TABLE `aowow_itemset` - CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `contentGroup`; - -ALTER TABLE `aowow_quests` - ALTER `holidayId` DROP DEFAULT; -ALTER TABLE `aowow_quests` - CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `timeLimit`; - -ALTER TABLE `aowow_titles` - ALTER `holidayId` DROP DEFAULT; -ALTER TABLE `aowow_titles` - CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `src12Ext`; - -ALTER TABLE `aowow_comments` - ALTER `typeId` DROP DEFAULT; -ALTER TABLE `aowow_comments` - CHANGE COLUMN `typeId` `typeId` INT(10) NOT NULL COMMENT 'ID Of Page' AFTER `type`; - --- --------------- --- try to reconstruct CommunityContent for TYPE_WORLDEVENT (12) --- --------------- -UPDATE `aowow_comments` c, `aowow_events` e SET c.`typeId` = e.`id` WHERE c.`type` = 12 AND c.`typeId` > 0 AND c.`typeId` = e.`holidayId`; -UPDATE `aowow_comments` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; -UPDATE `aowow_screenshots` s, `aowow_events` e SET s.`typeId` = e.`id` WHERE s.`type` = 12 AND s.`typeId` > 0 AND s.`typeId` = e.`holidayId`; -UPDATE `aowow_screenshots` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; -UPDATE `aowow_videos` v, `aowow_events` e SET v.`typeId` = e.`id` WHERE v.`type` = 12 AND v.`typeId` > 0 AND v.`typeId` = e.`holidayId`; -UPDATE `aowow_videos` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; - --- --------------- --- drop not recoverable comments --- --------------- -DELETE FROM `aowow_account_reputation` WHERE `action` IN (3, 4, 5) AND `sourceA` IN ( - SELECT x.`id` FROM ( - SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION - SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 - ) AS x -) - -DELETE FROM `aowow_comments_rates` WHERE `commentId` IN ( - SELECT x.`id` FROM ( - SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION - SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 - ) AS x -) - -DELETE FROM `aowow_comments` WHERE `id` IN ( - SELECT x.`id` FROM ( - SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION - SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 - ) AS x -) +ALTER TABLE `aowow_items` + ALTER `holidayId` DROP DEFAULT; +ALTER TABLE `aowow_items` + CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `itemLimitCategory`; + +ALTER TABLE `aowow_itemset` + ALTER `holidayId` DROP DEFAULT; +ALTER TABLE `aowow_itemset` + CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `contentGroup`; + +ALTER TABLE `aowow_quests` + ALTER `holidayId` DROP DEFAULT; +ALTER TABLE `aowow_quests` + CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `timeLimit`; + +ALTER TABLE `aowow_titles` + ALTER `holidayId` DROP DEFAULT; +ALTER TABLE `aowow_titles` + CHANGE COLUMN `holidayId` `eventId` SMALLINT(5) UNSIGNED NOT NULL AFTER `src12Ext`; + +ALTER TABLE `aowow_comments` + ALTER `typeId` DROP DEFAULT; +ALTER TABLE `aowow_comments` + CHANGE COLUMN `typeId` `typeId` INT(10) NOT NULL COMMENT 'ID Of Page' AFTER `type`; + +-- --------------- +-- try to reconstruct CommunityContent for TYPE_WORLDEVENT (12) +-- --------------- +UPDATE `aowow_comments` c, `aowow_events` e SET c.`typeId` = e.`id` WHERE c.`type` = 12 AND c.`typeId` > 0 AND c.`typeId` = e.`holidayId`; +UPDATE `aowow_comments` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; +UPDATE `aowow_screenshots` s, `aowow_events` e SET s.`typeId` = e.`id` WHERE s.`type` = 12 AND s.`typeId` > 0 AND s.`typeId` = e.`holidayId`; +UPDATE `aowow_screenshots` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; +UPDATE `aowow_videos` v, `aowow_events` e SET v.`typeId` = e.`id` WHERE v.`type` = 12 AND v.`typeId` > 0 AND v.`typeId` = e.`holidayId`; +UPDATE `aowow_videos` SET `typeId` = -`typeId` WHERE `type` = 12 AND `typeId` < 0; + +-- --------------- +-- drop not recoverable comments +-- --------------- +DELETE FROM `aowow_account_reputation` WHERE `action` IN (3, 4, 5) AND `sourceA` IN ( + SELECT x.`id` FROM ( + SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION + SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 + ) AS x +) + +DELETE FROM `aowow_comments_rates` WHERE `commentId` IN ( + SELECT x.`id` FROM ( + SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION + SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 + ) AS x +) + +DELETE FROM `aowow_comments` WHERE `id` IN ( + SELECT x.`id` FROM ( + SELECT c2.id FROM `aowow_comments` c1 JOIN `aowow_comments` c2 ON c2.`replyTo` = c1.`id` WHERE c1.`type` = 12 AND c1.`typeId` = 0 UNION + SELECT id FROM `aowow_comments` WHERE `type` = 12 AND `typeId` = 0 + ) AS x +) diff --git a/setup/updates/1436735830_01.sql b/setup/updates/1436735830_01.sql index aaaa936d..0d207ef8 100644 --- a/setup/updates/1436735830_01.sql +++ b/setup/updates/1436735830_01.sql @@ -1,52 +1,52 @@ -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_search'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_default'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_quicksearch'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_none'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'ttl_rss'; -UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_decay'; -UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session_timeout_delay'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_failed_auth_block'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_failed_auth_count'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'name'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'name_short'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'board_url'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'contact_email'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'battlegroup'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_allow_register'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'debug'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'maintenance'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_auth_mode'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_upvote'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_downvote'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_comment'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_supervote'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_votemore_base'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_register'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_upvoted'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_downvoted'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_good_report'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_bad_report'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_dailyvisit'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_user_warned'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_comment'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_premium'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_upload'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_article'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_user_suspended'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'user_max_votes'; -UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_votemore_add'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'force_ssl'; -UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_mode'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'locales'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_create_save_decay'; -UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_recovery_decay'; -UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'serialize_precision'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'screenshot_min_size'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'site_host'; -UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'static_host'; -UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'memory_limit'; -UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session.gc_maxlifetime'; -UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session.gc_probability'; -UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'default_charset'; -UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session_cache_dir'; -UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_dir'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_search'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_default'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_quicksearch'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'sql_limit_none'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'ttl_rss'; +UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_decay'; +UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session_timeout_delay'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_failed_auth_block'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_failed_auth_count'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'name'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'name_short'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'board_url'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'contact_email'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'battlegroup'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_allow_register'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'debug'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'maintenance'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_auth_mode'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_upvote'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_downvote'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_comment'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_supervote'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_votemore_base'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_register'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_upvoted'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_downvoted'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_good_report'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_bad_report'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_dailyvisit'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_user_warned'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_comment'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_premium'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_upload'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_article'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_reward_user_suspended'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'user_max_votes'; +UPDATE `aowow_config` SET `cat` = 4 WHERE `key` = 'rep_req_votemore_add'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'force_ssl'; +UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_mode'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'locales'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_create_save_decay'; +UPDATE `aowow_config` SET `cat` = 2 WHERE `key` = 'acc_recovery_decay'; +UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'serialize_precision'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'screenshot_min_size'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'site_host'; +UPDATE `aowow_config` SET `cat` = 0 WHERE `key` = 'static_host'; +UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'memory_limit'; +UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session.gc_maxlifetime'; +UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session.gc_probability'; +UPDATE `aowow_config` SET `cat` = 5 WHERE `key` = 'default_charset'; +UPDATE `aowow_config` SET `cat` = 3 WHERE `key` = 'session_cache_dir'; +UPDATE `aowow_config` SET `cat` = 1 WHERE `key` = 'cache_dir'; diff --git a/setup/updates/1436739821_01.sql b/setup/updates/1436739821_01.sql index ef35abfa..fe941bce 100644 --- a/setup/updates/1436739821_01.sql +++ b/setup/updates/1436739821_01.sql @@ -1 +1 @@ -INSERT IGNORE INTO aowow_config (`key`, `value`, `cat`, `flags`, `comment`) VALUES ('session.gc_divisor', 100, 3, 200, 'default: 100 - probability to remove session data on garbage collection'); +INSERT IGNORE INTO aowow_config (`key`, `value`, `cat`, `flags`, `comment`) VALUES ('session.gc_divisor', 100, 3, 200, 'default: 100 - probability to remove session data on garbage collection'); diff --git a/setup/updates/1436903207_01.sql b/setup/updates/1436903207_01.sql index 11eacb0f..4be2bd09 100644 --- a/setup/updates/1436903207_01.sql +++ b/setup/updates/1436903207_01.sql @@ -1,4 +1,4 @@ -ALTER TABLE `aowow_comments` - DROP INDEX `id`, - ADD PRIMARY KEY (`id`), - ADD INDEX `type_typeId` (`type`, `typeId`); +ALTER TABLE `aowow_comments` + DROP INDEX `id`, + ADD PRIMARY KEY (`id`), + ADD INDEX `type_typeId` (`type`, `typeId`); diff --git a/setup/updates/1437329787_01.sql b/setup/updates/1437329787_01.sql index 4d1e8434..50666941 100644 --- a/setup/updates/1437329787_01.sql +++ b/setup/updates/1437329787_01.sql @@ -1,15 +1,15 @@ -ALTER TABLE `aowow_objects` - DROP COLUMN `questItem1`, - DROP COLUMN `questItem2`, - DROP COLUMN `questItem3`, - DROP COLUMN `questItem4`, - DROP COLUMN `questItem5`, - DROP COLUMN `questItem6`; - -ALTER TABLE `aowow_creature` - DROP COLUMN `questItem1`, - DROP COLUMN `questItem2`, - DROP COLUMN `questItem3`, - DROP COLUMN `questItem4`, - DROP COLUMN `questItem5`, - DROP COLUMN `questItem6`; +ALTER TABLE `aowow_objects` + DROP COLUMN `questItem1`, + DROP COLUMN `questItem2`, + DROP COLUMN `questItem3`, + DROP COLUMN `questItem4`, + DROP COLUMN `questItem5`, + DROP COLUMN `questItem6`; + +ALTER TABLE `aowow_creature` + DROP COLUMN `questItem1`, + DROP COLUMN `questItem2`, + DROP COLUMN `questItem3`, + DROP COLUMN `questItem4`, + DROP COLUMN `questItem5`, + DROP COLUMN `questItem6`; diff --git a/setup/updates/1437430574_01.sql b/setup/updates/1437430574_01.sql index 2d609c46..bb799607 100644 --- a/setup/updates/1437430574_01.sql +++ b/setup/updates/1437430574_01.sql @@ -1,31 +1,31 @@ -DROP TABLE IF EXISTS `aowow_emotes`; -CREATE TABLE `aowow_emotes` ( - `id` SMALLINT(5) UNSIGNED NOT NULL, - `cmd` VARCHAR(15) NOT NULL, - `isAnimated` TINYINT(1) UNSIGNED NOT NULL, - `target_loc0` VARCHAR(65) NULL DEFAULT NULL, - `target_loc2` VARCHAR(70) NULL DEFAULT NULL, - `target_loc3` VARCHAR(95) NULL DEFAULT NULL, - `target_loc6` VARCHAR(90) NULL DEFAULT NULL, - `target_loc8` VARCHAR(70) NULL DEFAULT NULL, - `noTarget_loc0` VARCHAR(65) NULL DEFAULT NULL, - `noTarget_loc2` VARCHAR(110) NULL DEFAULT NULL, - `noTarget_loc3` VARCHAR(85) NULL DEFAULT NULL, - `noTarget_loc6` VARCHAR(75) NULL DEFAULT NULL, - `noTarget_loc8` VARCHAR(60) NULL DEFAULT NULL, - `self_loc0` VARCHAR(65) NULL DEFAULT NULL, - `self_loc2` VARCHAR(115) NULL DEFAULT NULL, - `self_loc3` VARCHAR(85) NULL DEFAULT NULL, - `self_loc6` VARCHAR(75) NULL DEFAULT NULL, - `self_loc8` VARCHAR(70) NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM; - -DROP TABLE IF EXISTS `aowow_emotes_aliasses`; -CREATE TABLE `aowow_emotes_aliasses` ( - `id` SMALLINT(6) UNSIGNED NOT NULL, - `locales` SMALLINT(6) UNSIGNED NOT NULL, - `command` VARCHAR(15) NOT NULL, - UNIQUE INDEX `id_command` (`id`, `command`), - INDEX `id` (`id`) -) ENGINE=MyISAM; +DROP TABLE IF EXISTS `aowow_emotes`; +CREATE TABLE `aowow_emotes` ( + `id` SMALLINT(5) UNSIGNED NOT NULL, + `cmd` VARCHAR(15) NOT NULL, + `isAnimated` TINYINT(1) UNSIGNED NOT NULL, + `target_loc0` VARCHAR(65) NULL DEFAULT NULL, + `target_loc2` VARCHAR(70) NULL DEFAULT NULL, + `target_loc3` VARCHAR(95) NULL DEFAULT NULL, + `target_loc6` VARCHAR(90) NULL DEFAULT NULL, + `target_loc8` VARCHAR(70) NULL DEFAULT NULL, + `noTarget_loc0` VARCHAR(65) NULL DEFAULT NULL, + `noTarget_loc2` VARCHAR(110) NULL DEFAULT NULL, + `noTarget_loc3` VARCHAR(85) NULL DEFAULT NULL, + `noTarget_loc6` VARCHAR(75) NULL DEFAULT NULL, + `noTarget_loc8` VARCHAR(60) NULL DEFAULT NULL, + `self_loc0` VARCHAR(65) NULL DEFAULT NULL, + `self_loc2` VARCHAR(115) NULL DEFAULT NULL, + `self_loc3` VARCHAR(85) NULL DEFAULT NULL, + `self_loc6` VARCHAR(75) NULL DEFAULT NULL, + `self_loc8` VARCHAR(70) NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM; + +DROP TABLE IF EXISTS `aowow_emotes_aliasses`; +CREATE TABLE `aowow_emotes_aliasses` ( + `id` SMALLINT(6) UNSIGNED NOT NULL, + `locales` SMALLINT(6) UNSIGNED NOT NULL, + `command` VARCHAR(15) NOT NULL, + UNIQUE INDEX `id_command` (`id`, `command`), + INDEX `id` (`id`) +) ENGINE=MyISAM; diff --git a/setup/updates/1437472069_01.sql b/setup/updates/1437472069_01.sql index 80aba39e..7c3db404 100644 --- a/setup/updates/1437472069_01.sql +++ b/setup/updates/1437472069_01.sql @@ -1,2 +1,2 @@ -ALTER TABLE `aowow_emotes` - ADD COLUMN `cuFlags` INT UNSIGNED NOT NULL AFTER `isAnimated`; +ALTER TABLE `aowow_emotes` + ADD COLUMN `cuFlags` INT UNSIGNED NOT NULL AFTER `isAnimated`; diff --git a/setup/updates/1438620486_01.sql b/setup/updates/1438620486_01.sql index 2c56ff11..e89a81f8 100644 --- a/setup/updates/1438620486_01.sql +++ b/setup/updates/1438620486_01.sql @@ -1,68 +1,68 @@ --- structure changed hard -DROP TABLE IF EXISTS `dbc_spellitemenchantment`; -DROP TABLE IF EXISTS `aowow_itemenchantment`; -CREATE TABLE `aowow_itemenchantment` ( - `id` smallint(5) unsigned NOT NULL, - `charges` tinyint(4) unsigned NOT NULL, - `cuFlags` int(10) unsigned NOT NULL, - `procChance` tinyint(3) unsigned NOT NULL, - `ppmRate` float NOT NULL, - `type1` tinyint(4) unsigned NOT NULL, - `type2` tinyint(4) unsigned NOT NULL, - `type3` tinyint(4) unsigned NOT NULL, - `amount1` smallint(5) NOT NULL, - `amount2` smallint(5) NOT NULL, - `amount3` smallint(5) NOT NULL, - `object1` mediumint(9) unsigned NOT NULL, - `object2` mediumint(9) unsigned NOT NULL, - `object3` smallint(5) unsigned NOT NULL, - `name_loc0` varchar(65) NOT NULL, - `name_loc2` varchar(91) NOT NULL, - `name_loc3` varchar(84) NOT NULL, - `name_loc6` varchar(89) NOT NULL, - `name_loc8` varchar(96) NOT NULL, - `conditionId` tinyint(3) unsigned NOT NULL, - `skillLine` smallint(5) unsigned NOT NULL, - `skillLevel` smallint(5) unsigned NOT NULL, - `requiredLevel` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -ALTER TABLE `aowow_item_stats` - ALTER `id` DROP DEFAULT; -ALTER TABLE `aowow_item_stats` - ADD COLUMN `type` smallint(5) unsigned NOT NULL FIRST, - CHANGE COLUMN `id` `typeId` mediumint(9) unsigned NOT NULL AFTER `type`, - DROP INDEX `item`, - DROP PRIMARY KEY, - ADD PRIMARY KEY (`typeId`, `type`); - -UPDATE `aowow_item_stats` SET `type` = 3; - -ALTER TABLE `aowow_articles` - ALTER `type` DROP DEFAULT, - ALTER `typeId` DROP DEFAULT; -ALTER TABLE `aowow_articles` - CHANGE COLUMN `type` `type` smallint(5) NOT NULL FIRST, - CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; - -ALTER TABLE `aowow_comments` - ALTER `type` DROP DEFAULT, - ALTER `typeId` DROP DEFAULT; -ALTER TABLE `aowow_comments` - CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL COMMENT 'Type of Page' AFTER `id`, - CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL COMMENT 'ID Of Page' AFTER `type`; - -ALTER TABLE `aowow_screenshots` - ALTER `type` DROP DEFAULT; - ALTER `typeId` DROP DEFAULT; -ALTER TABLE `aowow_screenshots` - CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL AFTER `id`, - CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; - -ALTER TABLE `aowow_videos` - ALTER `type` DROP DEFAULT, - ALTER `typeId` DROP DEFAULT; -ALTER TABLE `aowow_videos` - CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL AFTER `id`, - CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; +-- structure changed hard +DROP TABLE IF EXISTS `dbc_spellitemenchantment`; +DROP TABLE IF EXISTS `aowow_itemenchantment`; +CREATE TABLE `aowow_itemenchantment` ( + `id` smallint(5) unsigned NOT NULL, + `charges` tinyint(4) unsigned NOT NULL, + `cuFlags` int(10) unsigned NOT NULL, + `procChance` tinyint(3) unsigned NOT NULL, + `ppmRate` float NOT NULL, + `type1` tinyint(4) unsigned NOT NULL, + `type2` tinyint(4) unsigned NOT NULL, + `type3` tinyint(4) unsigned NOT NULL, + `amount1` smallint(5) NOT NULL, + `amount2` smallint(5) NOT NULL, + `amount3` smallint(5) NOT NULL, + `object1` mediumint(9) unsigned NOT NULL, + `object2` mediumint(9) unsigned NOT NULL, + `object3` smallint(5) unsigned NOT NULL, + `name_loc0` varchar(65) NOT NULL, + `name_loc2` varchar(91) NOT NULL, + `name_loc3` varchar(84) NOT NULL, + `name_loc6` varchar(89) NOT NULL, + `name_loc8` varchar(96) NOT NULL, + `conditionId` tinyint(3) unsigned NOT NULL, + `skillLine` smallint(5) unsigned NOT NULL, + `skillLevel` smallint(5) unsigned NOT NULL, + `requiredLevel` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `aowow_item_stats` + ALTER `id` DROP DEFAULT; +ALTER TABLE `aowow_item_stats` + ADD COLUMN `type` smallint(5) unsigned NOT NULL FIRST, + CHANGE COLUMN `id` `typeId` mediumint(9) unsigned NOT NULL AFTER `type`, + DROP INDEX `item`, + DROP PRIMARY KEY, + ADD PRIMARY KEY (`typeId`, `type`); + +UPDATE `aowow_item_stats` SET `type` = 3; + +ALTER TABLE `aowow_articles` + ALTER `type` DROP DEFAULT, + ALTER `typeId` DROP DEFAULT; +ALTER TABLE `aowow_articles` + CHANGE COLUMN `type` `type` smallint(5) NOT NULL FIRST, + CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; + +ALTER TABLE `aowow_comments` + ALTER `type` DROP DEFAULT, + ALTER `typeId` DROP DEFAULT; +ALTER TABLE `aowow_comments` + CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL COMMENT 'Type of Page' AFTER `id`, + CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL COMMENT 'ID Of Page' AFTER `type`; + +ALTER TABLE `aowow_screenshots` + ALTER `type` DROP DEFAULT; + ALTER `typeId` DROP DEFAULT; +ALTER TABLE `aowow_screenshots` + CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL AFTER `id`, + CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; + +ALTER TABLE `aowow_videos` + ALTER `type` DROP DEFAULT, + ALTER `typeId` DROP DEFAULT; +ALTER TABLE `aowow_videos` + CHANGE COLUMN `type` `type` smallint(5) unsigned NOT NULL AFTER `id`, + CHANGE COLUMN `typeId` `typeId` mediumint(9) NOT NULL AFTER `type`; diff --git a/setup/updates/1438715648_01.sql b/setup/updates/1438715648_01.sql index 3a2d5386..9dcdd788 100644 --- a/setup/updates/1438715648_01.sql +++ b/setup/updates/1438715648_01.sql @@ -1,23 +1,23 @@ -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=341', 'event=1'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=141', 'event=2'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=376', 'event=3'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=374', 'event=4'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=375', 'event=5'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=327', 'event=7'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=423', 'event=8'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=181', 'event=9'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=201', 'event=10'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=321', 'event=11'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=324', 'event=12'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=301', 'event=15'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=283', 'event=18'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=284', 'event=19'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=285', 'event=20'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=353', 'event=21'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=372', 'event=24'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=404', 'event=26'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=398', 'event=50'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=409', 'event=51'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=400', 'event=53'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=420', 'event=54'); -UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=424', 'event=63'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=341', 'event=1'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=141', 'event=2'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=376', 'event=3'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=374', 'event=4'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=375', 'event=5'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=327', 'event=7'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=423', 'event=8'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=181', 'event=9'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=201', 'event=10'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=321', 'event=11'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=324', 'event=12'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=301', 'event=15'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=283', 'event=18'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=284', 'event=19'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=285', 'event=20'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=353', 'event=21'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=372', 'event=24'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=404', 'event=26'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=398', 'event=50'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=409', 'event=51'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=400', 'event=53'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=420', 'event=54'); +UPDATE `aowow_articles` SET `article`= REPLACE(`article`, 'event=424', 'event=63'); diff --git a/setup/updates/1438878038_01.sql b/setup/updates/1438878038_01.sql index edf5f3df..ed780c13 100644 --- a/setup/updates/1438878038_01.sql +++ b/setup/updates/1438878038_01.sql @@ -1,53 +1,53 @@ -SET FOREIGN_KEY_CHECKS=0; - -RENAME TABLE `aowow_news` TO `aowow_home_featuredbox`; -ALTER TABLE `aowow_home_featuredbox` - ALTER `id` DROP DEFAULT, - ALTER `active` DROP DEFAULT; -ALTER TABLE `aowow_home_featuredbox` - ENGINE=InnoDB, - CHANGE COLUMN `id` `id` smallint(5) unsigned NOT NULL FIRST, - ADD COLUMN `editorId` int(10) unsigned NULL AFTER `id`, - ADD COLUMN `editDate` int(10) unsigned NOT NULL AFTER `editorId`, - CHANGE COLUMN `active` `active` tinyint(1) unsigned NOT NULL AFTER `editDate`, - ADD CONSTRAINT `FK_acc_hFBox` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; - -RENAME TABLE `aowow_news_overlay` TO `aowow_home_featuredbox_overlay`; -ALTER TABLE `aowow_home_featuredbox_overlay` - ALTER `newsId` DROP DEFAULT; -ALTER TABLE `aowow_home_featuredbox_overlay` - ENGINE=InnoDB, - CHANGE COLUMN `newsId` `featureId` smallint(5) unsigned NOT NULL FIRST, - ADD CONSTRAINT `FK_home_featurebox` FOREIGN KEY (`featureId`) REFERENCES `aowow_home_featuredbox` (`id`) ON UPDATE CASCADE ON DELETE CASCADE; - -CREATE TABLE `aowow_home_titles` ( - `id` smallint(5) unsigned NOT NULL, - `editorId` int(10) unsigned NULL, - `editDate` int(10) unsigned NOT NULL, - `active` tinyint(1) unsigned NOT NULL, - `title_loc0` varchar(100) NOT NULL, - `title_loc2` varchar(100) NOT NULL, - `title_loc3` varchar(100) NOT NULL, - `title_loc6` varchar(100) NOT NULL, - `title_loc8` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_acc_hTitles` (`editorId`), - CONSTRAINT `FK_acc_hTitles` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL -) ENGINE=InnoDB; - -CREATE TABLE `aowow_home_oneliner` ( - `id` smallint(5) unsigned NOT NULL, - `editorId` int(10) unsigned NULL, - `editDate` int(10) unsigned NOT NULL, - `active` tinyint(1) unsigned NOT NULL, - `text_loc0` varchar(200) NOT NULL, - `text_loc2` varchar(200) NOT NULL, - `text_loc3` varchar(200) NOT NULL, - `text_loc6` varchar(200) NOT NULL, - `text_loc8` varchar(200) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_acc_hOneliner` (`editorId`), - CONSTRAINT `FK_acc_hOneliner` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL -) ENGINE=InnoDB; - -SET FOREIGN_KEY_CHECKS=1; +SET FOREIGN_KEY_CHECKS=0; + +RENAME TABLE `aowow_news` TO `aowow_home_featuredbox`; +ALTER TABLE `aowow_home_featuredbox` + ALTER `id` DROP DEFAULT, + ALTER `active` DROP DEFAULT; +ALTER TABLE `aowow_home_featuredbox` + ENGINE=InnoDB, + CHANGE COLUMN `id` `id` smallint(5) unsigned NOT NULL FIRST, + ADD COLUMN `editorId` int(10) unsigned NULL AFTER `id`, + ADD COLUMN `editDate` int(10) unsigned NOT NULL AFTER `editorId`, + CHANGE COLUMN `active` `active` tinyint(1) unsigned NOT NULL AFTER `editDate`, + ADD CONSTRAINT `FK_acc_hFBox` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; + +RENAME TABLE `aowow_news_overlay` TO `aowow_home_featuredbox_overlay`; +ALTER TABLE `aowow_home_featuredbox_overlay` + ALTER `newsId` DROP DEFAULT; +ALTER TABLE `aowow_home_featuredbox_overlay` + ENGINE=InnoDB, + CHANGE COLUMN `newsId` `featureId` smallint(5) unsigned NOT NULL FIRST, + ADD CONSTRAINT `FK_home_featurebox` FOREIGN KEY (`featureId`) REFERENCES `aowow_home_featuredbox` (`id`) ON UPDATE CASCADE ON DELETE CASCADE; + +CREATE TABLE `aowow_home_titles` ( + `id` smallint(5) unsigned NOT NULL, + `editorId` int(10) unsigned NULL, + `editDate` int(10) unsigned NOT NULL, + `active` tinyint(1) unsigned NOT NULL, + `title_loc0` varchar(100) NOT NULL, + `title_loc2` varchar(100) NOT NULL, + `title_loc3` varchar(100) NOT NULL, + `title_loc6` varchar(100) NOT NULL, + `title_loc8` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + INDEX `FK_acc_hTitles` (`editorId`), + CONSTRAINT `FK_acc_hTitles` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL +) ENGINE=InnoDB; + +CREATE TABLE `aowow_home_oneliner` ( + `id` smallint(5) unsigned NOT NULL, + `editorId` int(10) unsigned NULL, + `editDate` int(10) unsigned NOT NULL, + `active` tinyint(1) unsigned NOT NULL, + `text_loc0` varchar(200) NOT NULL, + `text_loc2` varchar(200) NOT NULL, + `text_loc3` varchar(200) NOT NULL, + `text_loc6` varchar(200) NOT NULL, + `text_loc8` varchar(200) NOT NULL, + PRIMARY KEY (`id`), + INDEX `FK_acc_hOneliner` (`editorId`), + CONSTRAINT `FK_acc_hOneliner` FOREIGN KEY (`editorId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL +) ENGINE=InnoDB; + +SET FOREIGN_KEY_CHECKS=1; diff --git a/setup/updates/1438970456_01.sql b/setup/updates/1438970456_01.sql index 9d5a95b0..2f62aaf2 100644 --- a/setup/updates/1438970456_01.sql +++ b/setup/updates/1438970456_01.sql @@ -1,3 +1,3 @@ -ALTER TABLE `aowow_dbversion` - ADD COLUMN `sql` TEXT NOT NULL AFTER `part`, - ADD COLUMN `build` TEXT NOT NULL AFTER `sql`; +ALTER TABLE `aowow_dbversion` + ADD COLUMN `sql` TEXT NOT NULL AFTER `part`, + ADD COLUMN `build` TEXT NOT NULL AFTER `sql`; diff --git a/setup/updates/1439297934_01.sql b/setup/updates/1439297934_01.sql index 51f5e0a3..589196f1 100644 --- a/setup/updates/1439297934_01.sql +++ b/setup/updates/1439297934_01.sql @@ -1,15 +1,15 @@ -DROP TABLE IF EXISTS `aowow_talents`; -CREATE TABLE `aowow_talents` ( - `id` smallint(5) unsigned NOT NULL, - `class` tinyint(3) unsigned NOT NULL, - `tab` tinyint(3) unsigned NOT NULL, - `row` tinyint(3) unsigned NOT NULL, - `col` tinyint(3) unsigned NOT NULL, - `spell` mediumint(8) unsigned NOT NULL, - `rank` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`id`, `rank`), - INDEX `spell` (`spell`), - INDEX `class` (`class`) -) ENGINE=MyISAM; - -UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' talents'); +DROP TABLE IF EXISTS `aowow_talents`; +CREATE TABLE `aowow_talents` ( + `id` smallint(5) unsigned NOT NULL, + `class` tinyint(3) unsigned NOT NULL, + `tab` tinyint(3) unsigned NOT NULL, + `row` tinyint(3) unsigned NOT NULL, + `col` tinyint(3) unsigned NOT NULL, + `spell` mediumint(8) unsigned NOT NULL, + `rank` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`id`, `rank`), + INDEX `spell` (`spell`), + INDEX `class` (`class`) +) ENGINE=MyISAM; + +UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' talents'); diff --git a/setup/updates/1439469082_01.sql b/setup/updates/1439469082_01.sql index 34e1c68d..8b35b737 100644 --- a/setup/updates/1439469082_01.sql +++ b/setup/updates/1439469082_01.sql @@ -1 +1 @@ -UPDATE `aowow_dbversion` SET `build` = CONCAT(`build`, ' itemScaling'); +UPDATE `aowow_dbversion` SET `build` = CONCAT(`build`, ' itemScaling'); diff --git a/setup/updates/1439590146_01.sql b/setup/updates/1439590146_01.sql index fec077a0..82892ff9 100644 --- a/setup/updates/1439590146_01.sql +++ b/setup/updates/1439590146_01.sql @@ -1,7 +1,7 @@ -ALTER TABLE `aowow_titles` - ADD COLUMN `bitIdx` tinyint(3) unsigned NOT NULL AFTER `eventId`, - ADD INDEX `bitIdx` (`bitIdx`); - -DROP TABLE IF EXISTS `dbc_chartitles`; - -UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' titles'); +ALTER TABLE `aowow_titles` + ADD COLUMN `bitIdx` tinyint(3) unsigned NOT NULL AFTER `eventId`, + ADD INDEX `bitIdx` (`bitIdx`); + +DROP TABLE IF EXISTS `dbc_chartitles`; + +UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' titles'); diff --git a/setup/updates/1439840492_01.sql b/setup/updates/1439840492_01.sql index 8d0c8583..c972798e 100644 --- a/setup/updates/1439840492_01.sql +++ b/setup/updates/1439840492_01.sql @@ -1 +1 @@ -UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats'); +UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats'); diff --git a/setup/updates/1439909965_01.sql b/setup/updates/1439909965_01.sql index 8d0c8583..c972798e 100644 --- a/setup/updates/1439909965_01.sql +++ b/setup/updates/1439909965_01.sql @@ -1 +1 @@ -UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats'); +UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats'); diff --git a/setup/updates/1439924313_01.sql b/setup/updates/1439924313_01.sql index 87ac9aa3..1dffac3e 100644 --- a/setup/updates/1439924313_01.sql +++ b/setup/updates/1439924313_01.sql @@ -1,2 +1 @@ UPDATE aowow_dbversion SET `sql`= CONCAT(`sql`, ' spawns'); - diff --git a/setup/updates/1445293761_01.sql b/setup/updates/1445293761_01.sql index f58e5267..02aeedb0 100644 --- a/setup/updates/1445293761_01.sql +++ b/setup/updates/1445293761_01.sql @@ -1,2 +1,2 @@ -DELETE FROM `aowow_config` WHERE `cat` = 6; -INSERT INTO `aowow_config` VALUES ('analytics_user', '', 6, 0x88, 'default: - enter your GA-user here to track site stats'); +DELETE FROM `aowow_config` WHERE `cat` = 6; +INSERT INTO `aowow_config` VALUES ('analytics_user', '', 6, 0x88, 'default: - enter your GA-user here to track site stats'); diff --git a/setup/updates/1446293928_01.sql b/setup/updates/1446293928_01.sql index 726b9cba..b206ca4b 100644 --- a/setup/updates/1446293928_01.sql +++ b/setup/updates/1446293928_01.sql @@ -1,105 +1,101 @@ -DROP TABLE IF EXISTS `aowow_loot_link`; -CREATE TABLE `aowow_loot_link` ( - `npcId` MEDIUMINT(8) NOT NULL, - `objectId` MEDIUMINT(8) UNSIGNED NOT NULL, - UNIQUE INDEX `npcId` (`npcId`), - INDEX `objectId` (`objectId`) -) COLLATE='utf8_general_ci' ENGINE=MyISAM; - -INSERT INTO `aowow_loot_link` VALUES - -- if available HM-loot is show instead of regular loot (notably Ulduar) - -- Classic - -- no boss chests..? - -- BC - (17537, 185168), (18434, 185169), -- Ramparts NH/HC - Vazruden - (17536, 185168), (18432, 185169), -- Ramparts NH/HC - Nazan - (19218, 184465), (21525, 184849), -- The Mechanar NH/HC - Gatewatcher Gyro-Kill - (19710, 184465), (21526, 184849), -- The Mechanar NH/HC - Gatewatcher Iron-Hand - -- WotLK - (28234, 190586), (-28234, 193996), -- Halls of Stone NH/HC - Tribunal of Ages - (27656, 191349), (31561, 193603), -- Oculus NH/HC - Ley Guardian Eregos - (26533, 190663), (31217, 193597), -- CoT Stratholme NH/HC - Mal' Ganis - (16064, 181366), (30603, 193426), -- Naxxramas 10/25 - Thane Korth'azz - (16065, 181366), (30601, 193426), -- Naxxramas 10/25 - Lady Blaumeux - (30549, 181366), (30600, 193426), -- Naxxramas 10/25 - Baron Rivendare - (16063, 181366), (30602, 193426), -- Naxxramas 10/25 - Sir Zeliek - (28859, 193905), (31734, 193967), -- EoE 10/25 - Malygos - (32930, 195046), (33909, 195047), -- Ulduar 10/25 - Kologarn - (32865, 194313), (33147, 194315), -- Ulduar 10/25 - Thorim - (33350, 194957), (-33350, 194958), -- Ulduar 10/25 - Mimiron - (32845, 194200), (32846, 194201), -- Ulduar 10/25 - Hodir - (32906, 194324), (33360, 194325), -- Ulduar 10/25 - Freya - (32871, 194821), (33070, 194822), -- Ulduar 10/25 - Algalon - (35119, 195374), (35518, 195375), -- ToC5 NH/HC - Eadric the Pure - (34928, 195323), (35517, 195324), -- ToC5 NH/HC - Argent Confessor Paletress - (34705, 195709), (36088, 195710), -- Toc5 NH/HC - Marshal Jacob Alerius - (34702, 195709), (36082, 195710), -- Toc5 NH/HC - Ambrose Boltspark - (34701, 195709), (36083, 195710), -- Toc5 NH/HC - Colosos - (34657, 195709), (36086, 195710), -- Toc5 NH/HC - Jaelyne Evensong - (34703, 195709), (36087, 195710), -- Toc5 NH/HC - Lana Stouthammer - (35572, 195709), (36089, 195710), -- Toc5 NH/HC - Mokra the Skullcrusher - (35569, 195709), (36085, 195710), -- Toc5 NH/HC - Eressea Dawnsinger - (35571, 195709), (36090, 195710), -- Toc5 NH/HC - Runok Wildmane - (35570, 195709), (36091, 195710), -- Toc5 NH/HC - Zul'tore - (35617, 195709), (36084, 195710), -- Toc5 NH/HC - Deathstalker Visceri - (34441, 195631), (34442, 195632), -- ToC25 10/25 NM - Vivienne Blackwhisper - (34443, 195633), (-34443, 195635), -- ToC25 10/25 HC - Vivienne Blackwhisper - (34444, 195631), (35740, 195632), -- ToC25 10/25 NM - Thrakgar - (35741, 195633), (-35741, 195635), -- ToC25 10/25 HC - Thrakgar - (34445, 195631), (35705, 195632), -- ToC25 10/25 NM - Liandra Suncaller - (35706, 195633), (-35706, 195635), -- ToC25 10/25 HC - Liandra Suncaller - (34447, 195631), (35683, 195632), -- ToC25 10/25 NM - Caiphus the Stern - (35684, 195633), (-35684, 195635), -- ToC25 10/25 HC - Caiphus the Stern - (34448, 195631), (35724, 195632), -- ToC25 10/25 NM - Ruj'kah - (35725, 195633), (-35725, 195635), -- ToC25 10/25 HC - Ruj'kah - (34449, 195631), (35689, 195632), -- ToC25 10/25 NM - Ginselle Blightslinger - (35690, 195633), (-35690, 195635), -- ToC25 10/25 HC - Ginselle Blightslinger - (34450, 195631), (35695, 195632), -- ToC25 10/25 NM - Harkzog - (35696, 195633), (-35696, 195635), -- ToC25 10/25 HC - Harkzog - (34451, 195631), (35671, 195632), -- ToC25 10/25 NM - Birana Stormhoof - (35672, 195633), (-35672, 195635), -- ToC25 10/25 HC - Birana Stormhoof - (34453, 195631), (35718, 195632), -- ToC25 10/25 NM - Narrhok Steelbreaker - (35719, 195633), (-35719, 195635), -- ToC25 10/25 HC - Narrhok Steelbreaker - (34454, 195631), (35711, 195632), -- ToC25 10/25 NM - Maz'dinah - (35712, 195633), (-35712, 195635), -- ToC25 10/25 HC - Maz'dinah - (34455, 195631), (35680, 195632), -- ToC25 10/25 NM - Broln Stouthorn - (35681, 195633), (-35681, 195635), -- ToC25 10/25 HC - Broln Stouthorn - (34456, 195631), (35708, 195632), -- ToC25 10/25 NM - Malithas Brightblade - (35709, 195633), (-35709, 195635), -- ToC25 10/25 HC - Malithas Brightblade - (34458, 195631), (35692, 195632), -- ToC25 10/25 NM - Gorgrim Shadowcleave - (35693, 195633), (-35693, 195635), -- ToC25 10/25 HC - Gorgrim Shadowcleave - (34459, 195631), (35686, 195632), -- ToC25 10/25 NM - Erin Misthoof - (35687, 195633), (-35687, 195635), -- ToC25 10/25 HC - Erin Misthoof - (34460, 195631), (35702, 195632), -- ToC25 10/25 NM - Kavina Grovesong - (35703, 195633), (-35703, 195635), -- ToC25 10/25 HC - Kavina Grovesong - (34461, 195631), (35743, 195632), -- ToC25 10/25 NM - Tyrius Duskblade - (35744, 195633), (-35744, 195635), -- ToC25 10/25 HC - Tyrius Duskblade - (34463, 195631), (35734, 195632), -- ToC25 10/25 NM - Shaabad - (35735, 195633), (-35735, 195635), -- ToC25 10/25 HC - Shaabad - (34465, 195631), (35746, 195632), -- ToC25 10/25 NM - Velanaa - (35747, 195633), (-35747, 195635), -- ToC25 10/25 HC - Velanaa - (34466, 195631), (35665, 195632), -- ToC25 10/25 NM - Anthar Forgemender - (35666, 195633), (-35666, 195635), -- ToC25 10/25 HC - Anthar Forgemender - (34467, 195631), (35662, 195632), -- ToC25 10/25 NM - Alyssia Moonstalker - (35663, 195633), (-35663, 195635), -- ToC25 10/25 HC - Alyssia Moonstalker - (34468, 195631), (35721, 195632), -- ToC25 10/25 NM - Noozle Whizzlestick - (35722, 195633), (-35722, 195635), -- ToC25 10/25 HC - Noozle Whizzlestick - (34469, 195631), (35714, 195632), -- ToC25 10/25 NM - Melador Valestrider - (35715, 195633), (-35715, 195635), -- ToC25 10/25 HC - Melador Valestrider - (34470, 195631), (35728, 195632), -- ToC25 10/25 NM - Saamul - (35729, 195633), (-35729, 195635), -- ToC25 10/25 HC - Saamul - (34471, 195631), (35668, 195632), -- ToC25 10/25 NM - Baelnor Lightbearer - (35669, 195633), (-35669, 195635), -- ToC25 10/25 HC - Baelnor Lightbearer - (34472, 195631), (35699, 195632), -- ToC25 10/25 NM - Irieth Shadowstep - (35700, 195633), (-35700, 195635), -- ToC25 10/25 HC - Irieth Shadowstep - (34473, 195631), (35674, 195632), -- ToC25 10/25 NM - Brienna Nightfell - (35675, 195633), (-35675, 195635), -- ToC25 10/25 HC - Brienna Nightfell - (34474, 195631), (35731, 195632), -- ToC25 10/25 NM - Serissa Grimdabbler - (35732, 195633), (-35732, 195635), -- ToC25 10/25 HC - Serissa Grimdabbler - (34475, 195631), (35737, 195632), -- ToC25 10/25 NM - Shocuul - (35738, 195633), (-35738, 195635), -- ToC25 10/25 HC - Shocuul - (37226, 201710), (-37226, 202336), -- HoR NH/HC - The Lich King - (36948, 202178), (38157, 202180), -- ICC 10/25 NM - Muradin Bronzebread - (38639, 202177), (38640, 202179), -- ICC 10/25 HC - Muradin Bronzebread - (36939, 202178), (38156, 202180), -- ICC 10/25 NM - High Overlord Saurfang - (38637, 202177), (38638, 202179); -- ICC 10/25 HC - High Overlord Saurfang +DROP TABLE IF EXISTS `aowow_loot_link`; +CREATE TABLE `aowow_loot_link` ( + `npcId` MEDIUMINT(8) NOT NULL, + `objectId` MEDIUMINT(8) UNSIGNED NOT NULL, + UNIQUE INDEX `npcId` (`npcId`), + INDEX `objectId` (`objectId`) +) COLLATE='utf8_general_ci' ENGINE=MyISAM; + +-- if available HM-loot is show instead of regular loot (notably Ulduar) +INSERT INTO `aowow_loot_link` VALUES + (17537, 185168), (18434, 185169), + (17536, 185168), (18432, 185169), + (19218, 184465), (21525, 184849), + (19710, 184465), (21526, 184849), + (28234, 190586), (-28234, 193996), + (27656, 191349), (31561, 193603), + (26533, 190663), (31217, 193597), + (16064, 181366), (30603, 193426), + (16065, 181366), (30601, 193426), + (30549, 181366), (30600, 193426), + (16063, 181366), (30602, 193426), + (28859, 193905), (31734, 193967), + (32930, 195046), (33909, 195047), + (32865, 194313), (33147, 194315), + (33350, 194957), (-33350, 194958), + (32845, 194200), (32846, 194201), + (32906, 194324), (33360, 194325), + (32871, 194821), (33070, 194822), + (35119, 195374), (35518, 195375), + (34928, 195323), (35517, 195324), + (34705, 195709), (36088, 195710), + (34702, 195709), (36082, 195710), + (34701, 195709), (36083, 195710), + (34657, 195709), (36086, 195710), + (34703, 195709), (36087, 195710), + (35572, 195709), (36089, 195710), + (35569, 195709), (36085, 195710), + (35571, 195709), (36090, 195710), + (35570, 195709), (36091, 195710), + (35617, 195709), (36084, 195710), + (34441, 195631), (34442, 195632), + (34443, 195633), (-34443, 195635), + (34444, 195631), (35740, 195632), + (35741, 195633), (-35741, 195635), + (34445, 195631), (35705, 195632), + (35706, 195633), (-35706, 195635), + (34447, 195631), (35683, 195632), + (35684, 195633), (-35684, 195635), + (34448, 195631), (35724, 195632), + (35725, 195633), (-35725, 195635), + (34449, 195631), (35689, 195632), + (35690, 195633), (-35690, 195635), + (34450, 195631), (35695, 195632), + (35696, 195633), (-35696, 195635), + (34451, 195631), (35671, 195632), + (35672, 195633), (-35672, 195635), + (34453, 195631), (35718, 195632), + (35719, 195633), (-35719, 195635), + (34454, 195631), (35711, 195632), + (35712, 195633), (-35712, 195635), + (34455, 195631), (35680, 195632), + (35681, 195633), (-35681, 195635), + (34456, 195631), (35708, 195632), + (35709, 195633), (-35709, 195635), + (34458, 195631), (35692, 195632), + (35693, 195633), (-35693, 195635), + (34459, 195631), (35686, 195632), + (35687, 195633), (-35687, 195635), + (34460, 195631), (35702, 195632), + (35703, 195633), (-35703, 195635), + (34461, 195631), (35743, 195632), + (35744, 195633), (-35744, 195635), + (34463, 195631), (35734, 195632), + (35735, 195633), (-35735, 195635), + (34465, 195631), (35746, 195632), + (35747, 195633), (-35747, 195635), + (34466, 195631), (35665, 195632), + (35666, 195633), (-35666, 195635), + (34467, 195631), (35662, 195632), + (35663, 195633), (-35663, 195635), + (34468, 195631), (35721, 195632), + (35722, 195633), (-35722, 195635), + (34469, 195631), (35714, 195632), + (35715, 195633), (-35715, 195635), + (34470, 195631), (35728, 195632), + (35729, 195633), (-35729, 195635), + (34471, 195631), (35668, 195632), + (35669, 195633), (-35669, 195635), + (34472, 195631), (35699, 195632), + (35700, 195633), (-35700, 195635), + (34473, 195631), (35674, 195632), + (35675, 195633), (-35675, 195635), + (34474, 195631), (35731, 195632), + (35732, 195633), (-35732, 195635), + (34475, 195631), (35737, 195632), + (35738, 195633), (-35738, 195635), + (37226, 201710), (-37226, 202336), + (36948, 202178), (38157, 202180), + (38639, 202177), (38640, 202179), + (36939, 202178), (38156, 202180), + (38637, 202177), (38638, 202179); diff --git a/setup/updates/1446917082_01.sql b/setup/updates/1446917082_01.sql index a82aebdb..edb8d713 100644 --- a/setup/updates/1446917082_01.sql +++ b/setup/updates/1446917082_01.sql @@ -1,3 +1,3 @@ -ALTER TABLE `aowow_dbversion` - CHANGE COLUMN `sql` `sql` TEXT NULL AFTER `part`, - CHANGE COLUMN `build` `build` TEXT NULL AFTER `sql`; +ALTER TABLE `aowow_dbversion` + CHANGE COLUMN `sql` `sql` TEXT NULL AFTER `part`, + CHANGE COLUMN `build` `build` TEXT NULL AFTER `sql`; diff --git a/setup/updates/1448204650_01.sql b/setup/updates/1448204650_01.sql index 5b09223a..f154d6f3 100644 --- a/setup/updates/1448204650_01.sql +++ b/setup/updates/1448204650_01.sql @@ -1,3 +1,3 @@ -UPDATE aowow_config SET cat = cat + 1; -UPDATE aowow_config SET cat = 0 WHERE cat = 6; -UPDATE aowow_config SET cat = 6 WHERE cat = 7; +UPDATE aowow_config SET cat = cat + 1; +UPDATE aowow_config SET cat = 0 WHERE cat = 6; +UPDATE aowow_config SET cat = 6 WHERE cat = 7; diff --git a/setup/updates/1448727750_01.sql b/setup/updates/1448727750_01.sql index 50613cd5..f2e992a7 100644 --- a/setup/updates/1448727750_01.sql +++ b/setup/updates/1448727750_01.sql @@ -1 +1 @@ -UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' spell'); +UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' spell'); diff --git a/setup/updates/1452718627_01.sql b/setup/updates/1452718627_01.sql index 547fb1e1..8daff64d 100644 --- a/setup/updates/1452718627_01.sql +++ b/setup/updates/1452718627_01.sql @@ -1 +1 @@ -UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' item_stats'); +UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' item_stats'); diff --git a/setup/updates/1456585695_01.sql b/setup/updates/1456585695_01.sql index e24957da..bc72f34a 100644 --- a/setup/updates/1456585695_01.sql +++ b/setup/updates/1456585695_01.sql @@ -1,349 +1,349 @@ -SET FOREIGN_KEY_CHECKS=0; - --- create system account -REPLACE INTO `aowow_account` (`id`, `user`, `displayName`) VALUES (0, '', 'AoWoW'); - --- restructure weightscales (sorry for your loss...) -DROP TABLE IF EXISTS `aowow_account_weightscales`; -CREATE TABLE IF NOT EXISTS `aowow_account_weightscales` ( - `id` int(32) NOT NULL AUTO_INCREMENT, - `userId` int(10) unsigned NOT NULL, - `name` varchar(32) NOT NULL, - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `icon` varchar(48) NOT NULL DEFAULT '', - PRIMARY KEY (`id`,`userId`), - KEY `FK_acc_weights` (`userId`), - CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; - -INSERT INTO `aowow_account_weightscales` (`id`, `userId`, `name`, `class`, `icon`) VALUES - (1, 0, 'arms', 1, 'ability_rogue_eviscerate'), - (2, 0, 'fury', 1, 'ability_warrior_innerrage'), - (3, 0, 'prot', 1, 'ability_warrior_defensivestance'), - (4, 0, 'holy', 2, 'spell_holy_holybolt'), - (5, 0, 'prot', 2, 'ability_paladin_shieldofthetemplar'), - (6, 0, 'retrib', 2, 'spell_holy_auraoflight'), - (7, 0, 'beast', 3, 'ability_hunter_beasttaming'), - (8, 0, 'marks', 3, 'ability_marksmanship'), - (9, 0, 'surv', 3, 'ability_hunter_swiftstrike'), - (10, 0, 'assas', 4, 'ability_rogue_eviscerate'), - (11, 0, 'combat', 4, 'ability_backstab'), - (12, 0, 'subtle', 4, 'ability_stealth'), - (13, 0, 'disc', 5, 'spell_holy_wordfortitude'), - (14, 0, 'holy', 5, 'spell_holy_guardianspirit'), - (15, 0, 'shadow', 5, 'spell_shadow_shadowwordpain'), - (16, 0, 'blooddps', 6, 'spell_deathknight_bloodpresence'), - (17, 0, 'frostdps', 6, 'spell_deathknight_frostpresence'), - (18, 0, 'frosttank', 6, 'spell_deathknight_frostpresence'), - (19, 0, 'unholydps', 6, 'spell_deathknight_unholypresence'), - (20, 0, 'elem', 7, 'spell_nature_lightning'), - (21, 0, 'enhance', 7, 'spell_nature_lightningshield'), - (22, 0, 'resto', 7, 'spell_nature_magicimmunity'), - (23, 0, 'arcane', 8, 'spell_holy_magicalsentry'), - (24, 0, 'fire', 8, 'spell_fire_firebolt02'), - (25, 0, 'frost', 8, 'spell_frost_frostbolt02'), - (26, 0, 'afflic', 9, 'spell_shadow_deathcoil'), - (27, 0, 'demo', 9, 'spell_shadow_metamorphosis'), - (28, 0, 'destro', 9, 'spell_shadow_rainoffire'), - (29, 0, 'balance', 11, 'spell_nature_starfall'), - (30, 0, 'feraltank', 11, 'ability_racial_bearform'), - (31, 0, 'resto', 11, 'spell_nature_healingtouch'), - (32, 0, 'feraldps', 11, 'ability_druid_catform'); - -DROP TABLE IF EXISTS `aowow_account_weightscale_data`; -CREATE TABLE IF NOT EXISTS `aowow_account_weightscale_data` ( - `id` int(32) NOT NULL, - `field` varchar(15) NOT NULL, - `val` smallint(6) unsigned NOT NULL, - KEY `id` (`id`), - CONSTRAINT `FK_acc_weightscales` FOREIGN KEY (`id`) REFERENCES `aowow_account_weightscales` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO `aowow_account_weightscale_data` (`id`, `field`, `val`) VALUES - (2, 'exprtng', 100), - (2, 'str', 82), - (2, 'critstrkrtng', 66), - (2, 'agi', 53), - (2, 'armorpenrtng', 52), - (2, 'hitrtng', 48), - (2, 'hastertng', 36), - (2, 'atkpwr', 31), - (2, 'armor', 5), - (3, 'sta', 100), - (3, 'dodgertng', 90), - (3, 'defrtng', 86), - (3, 'block', 81), - (3, 'agi', 67), - (3, 'parryrtng', 67), - (3, 'blockrtng', 48), - (3, 'str', 48), - (3, 'exprtng', 19), - (3, 'hitrtng', 10), - (3, 'armorpenrtng', 10), - (3, 'critstrkrtng', 7), - (3, 'armor', 6), - (3, 'hastertng', 1), - (3, 'atkpwr', 1), - (4, 'int', 100), - (4, 'manargn', 88), - (4, 'splpwr', 58), - (4, 'critstrkrtng', 46), - (4, 'hastertng', 35), - (5, 'sta', 100), - (5, 'dodgertng', 94), - (5, 'block', 86), - (5, 'defrtng', 86), - (5, 'exprtng', 79), - (5, 'agi', 76), - (5, 'parryrtng', 76), - (5, 'hitrtng', 58), - (5, 'blockrtng', 52), - (5, 'str', 50), - (5, 'armor', 6), - (5, 'atkpwr', 6), - (5, 'splpwr', 4), - (5, 'critstrkrtng', 3), - (6, 'mledps', 470), - (6, 'hitrtng', 100), - (6, 'str', 80), - (6, 'exprtng', 66), - (6, 'critstrkrtng', 40), - (6, 'atkpwr', 34), - (6, 'agi', 32), - (6, 'hastertng', 30), - (6, 'armorpenrtng', 22), - (6, 'splpwr', 9), - (7, 'rgddps', 213), - (7, 'hitrtng', 100), - (7, 'agi', 58), - (7, 'critstrkrtng', 40), - (7, 'int', 37), - (7, 'atkpwr', 30), - (7, 'armorpenrtng', 28), - (7, 'hastertng', 21), - (8, 'rgddps', 379), - (8, 'hitrtng', 100), - (8, 'agi', 74), - (8, 'critstrkrtng', 57), - (8, 'armorpenrtng', 40), - (8, 'int', 39), - (8, 'atkpwr', 32), - (8, 'hastertng', 24), - (9, 'rgddps', 181), - (9, 'hitrtng', 100), - (9, 'agi', 76), - (9, 'critstrkrtng', 42), - (9, 'int', 35), - (9, 'hastertng', 31), - (9, 'atkpwr', 29), - (9, 'armorpenrtng', 26), - (10, 'mledps', 170), - (10, 'agi', 100), - (10, 'exprtng', 87), - (10, 'hitrtng', 83), - (10, 'critstrkrtng', 81), - (10, 'atkpwr', 65), - (10, 'armorpenrtng', 65), - (10, 'hastertng', 64), - (10, 'str', 55), - (11, 'mledps', 220), - (11, 'armorpenrtng', 100), - (11, 'agi', 100), - (11, 'exprtng', 82), - (11, 'hitrtng', 80), - (11, 'critstrkrtng', 75), - (11, 'hastertng', 73), - (11, 'str', 55), - (11, 'atkpwr', 50), - (12, 'mledps', 228), - (12, 'exprtng', 100), - (12, 'agi', 100), - (12, 'hitrtng', 80), - (12, 'armorpenrtng', 75), - (12, 'critstrkrtng', 75), - (12, 'hastertng', 75), - (12, 'str', 55), - (12, 'atkpwr', 50), - (13, 'splpwr', 100), - (13, 'manargn', 67), - (13, 'int', 65), - (13, 'hastertng', 59), - (13, 'critstrkrtng', 48), - (13, 'spi', 22), - (14, 'manargn', 100), - (14, 'int', 69), - (14, 'splpwr', 60), - (14, 'spi', 52), - (14, 'critstrkrtng', 38), - (14, 'hastertng', 31), - (15, 'hitrtng', 100), - (15, 'shasplpwr', 76), - (15, 'splpwr', 76), - (15, 'critstrkrtng', 54), - (15, 'hastertng', 50), - (15, 'spi', 16), - (15, 'int', 16), - (16, 'mledps', 360), - (16, 'armorpenrtng', 100), - (16, 'str', 99), - (16, 'hitrtng', 91), - (16, 'exprtng', 90), - (16, 'critstrkrtng', 57), - (16, 'hastertng', 55), - (16, 'atkpwr', 36), - (16, 'armor', 1), - (17, 'mledps', 337), - (17, 'hitrtng', 100), - (17, 'str', 97), - (17, 'exprtng', 81), - (17, 'armorpenrtng', 61), - (17, 'critstrkrtng', 45), - (17, 'atkpwr', 35), - (17, 'hastertng', 28), - (17, 'armor', 1), - (18, 'mledps', 419), - (18, 'parryrtng', 100), - (18, 'hitrtng', 97), - (18, 'str', 96), - (18, 'defrtng', 85), - (18, 'exprtng', 69), - (18, 'dodgertng', 61), - (18, 'agi', 61), - (18, 'sta', 61), - (18, 'critstrkrtng', 49), - (18, 'atkpwr', 41), - (18, 'armorpenrtng', 31), - (18, 'armor', 5), - (19, 'mledps', 209), - (19, 'str', 100), - (19, 'hitrtng', 66), - (19, 'exprtng', 51), - (19, 'hastertng', 48), - (19, 'critstrkrtng', 45), - (19, 'atkpwr', 34), - (19, 'armorpenrtng', 32), - (19, 'armor', 1), - (20, 'hitrtng', 100), - (20, 'splpwr', 60), - (20, 'hastertng', 56), - (20, 'critstrkrtng', 40), - (20, 'int', 11), - (21, 'mledps', 135), - (21, 'hitrtng', 100), - (21, 'exprtng', 84), - (21, 'agi', 55), - (21, 'int', 55), - (21, 'critstrkrtng', 55), - (21, 'hastertng', 42), - (21, 'str', 35), - (21, 'atkpwr', 32), - (21, 'splpwr', 29), - (21, 'armorpenrtng', 26), - (22, 'manargn', 100), - (22, 'int', 85), - (22, 'splpwr', 77), - (22, 'critstrkrtng', 62), - (22, 'hastertng', 35), - (23, 'hitrtng', 100), - (23, 'hastertng', 54), - (23, 'arcsplpwr', 49), - (23, 'splpwr', 49), - (23, 'critstrkrtng', 37), - (23, 'int', 34), - (23, 'frosplpwr', 24), - (23, 'firsplpwr', 24), - (23, 'spi', 14), - (24, 'hitrtng', 100), - (24, 'hastertng', 53), - (24, 'firsplpwr', 46), - (24, 'splpwr', 46), - (24, 'critstrkrtng', 43), - (24, 'frosplpwr', 23), - (24, 'arcsplpwr', 23), - (24, 'int', 13), - (25, 'hitrtng', 100), - (25, 'hastertng', 42), - (25, 'frosplpwr', 39), - (25, 'splpwr', 39), - (25, 'arcsplpwr', 19), - (25, 'firsplpwr', 19), - (25, 'critstrkrtng', 19), - (25, 'int', 6), - (26, 'hitrtng', 100), - (26, 'shasplpwr', 72), - (26, 'splpwr', 72), - (26, 'hastertng', 61), - (26, 'critstrkrtng', 38), - (26, 'firsplpwr', 36), - (26, 'spi', 34), - (26, 'int', 15), - (27, 'hitrtng', 100), - (27, 'hastertng', 50), - (27, 'firsplpwr', 45), - (27, 'shasplpwr', 45), - (27, 'splpwr', 45), - (27, 'critstrkrtng', 31), - (27, 'spi', 29), - (27, 'int', 13), - (28, 'hitrtng', 100), - (28, 'firsplpwr', 47), - (28, 'splpwr', 47), - (28, 'hastertng', 46), - (28, 'spi', 26), - (28, 'shasplpwr', 23), - (28, 'critstrkrtng', 16), - (28, 'int', 13), - (29, 'hitrtng', 100), - (29, 'splpwr', 66), - (29, 'hastertng', 54), - (29, 'critstrkrtng', 43), - (29, 'spi', 22), - (29, 'int', 22), - (30, 'agi', 100), - (30, 'sta', 75), - (30, 'dodgertng', 65), - (30, 'defrtng', 60), - (30, 'exprtng', 16), - (30, 'str', 10), - (30, 'armor', 10), - (30, 'hitrtng', 8), - (30, 'hastertng', 5), - (30, 'atkpwr', 4), - (30, 'feratkpwr', 4), - (30, 'critstrkrtng', 3), - (31, 'splpwr', 100), - (31, 'manargn', 73), - (31, 'hastertng', 57), - (31, 'int', 51), - (31, 'spi', 32), - (31, 'critstrkrtng', 11), - (32, 'agi', 100), - (32, 'armorpenrtng', 90), - (32, 'str', 80), - (32, 'critstrkrtng', 55), - (32, 'exprtng', 50), - (32, 'hitrtng', 50), - (32, 'feratkpwr', 40), - (32, 'atkpwr', 40), - (32, 'hastertng', 35); - --- add cascading to comments -DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_comments c ON c.id = r.commentId WHERE c.Id IS NULL; -DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_account a ON a.id = r.userId WHERE a.Id IS NULL; - -ALTER TABLE `aowow_comments` - ENGINE=InnoDB, - CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Comment ID' FIRST, - CHANGE COLUMN `replyTo` `replyTo` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Reply To, comment ID' AFTER `flags`, - CHANGE COLUMN `userId` `userId` INT(10) UNSIGNED NULL COMMENT 'User ID' AFTER `typeId`, - ADD CONSTRAINT `FK_acc_co` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; - -ALTER TABLE `aowow_comments_rates` - ENGINE=InnoDB, - ADD CONSTRAINT `FK_acc_co_rate` FOREIGN KEY (`commentId`) REFERENCES `aowow_comments` (`id`) ON UPDATE CASCADE ON DELETE CASCADE, - ADD CONSTRAINT `FK_acc_co_rate_user` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION; - --- auto-create datasets/weight-presets -UPDATE `aowow_dbversion` SET `build` = CONCAT(`build`, ' weightPresets'); - -SET FOREIGN_KEY_CHECKS=1; +SET FOREIGN_KEY_CHECKS=0; + +-- create system account +REPLACE INTO `aowow_account` (`id`, `user`, `displayName`) VALUES (0, '', 'AoWoW'); + +-- restructure weightscales (sorry for your loss...) +DROP TABLE IF EXISTS `aowow_account_weightscales`; +CREATE TABLE IF NOT EXISTS `aowow_account_weightscales` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `userId` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `icon` varchar(48) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`userId`), + KEY `FK_acc_weights` (`userId`), + CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; + +INSERT INTO `aowow_account_weightscales` (`id`, `userId`, `name`, `class`, `icon`) VALUES + (1, 0, 'arms', 1, 'ability_rogue_eviscerate'), + (2, 0, 'fury', 1, 'ability_warrior_innerrage'), + (3, 0, 'prot', 1, 'ability_warrior_defensivestance'), + (4, 0, 'holy', 2, 'spell_holy_holybolt'), + (5, 0, 'prot', 2, 'ability_paladin_shieldofthetemplar'), + (6, 0, 'retrib', 2, 'spell_holy_auraoflight'), + (7, 0, 'beast', 3, 'ability_hunter_beasttaming'), + (8, 0, 'marks', 3, 'ability_marksmanship'), + (9, 0, 'surv', 3, 'ability_hunter_swiftstrike'), + (10, 0, 'assas', 4, 'ability_rogue_eviscerate'), + (11, 0, 'combat', 4, 'ability_backstab'), + (12, 0, 'subtle', 4, 'ability_stealth'), + (13, 0, 'disc', 5, 'spell_holy_wordfortitude'), + (14, 0, 'holy', 5, 'spell_holy_guardianspirit'), + (15, 0, 'shadow', 5, 'spell_shadow_shadowwordpain'), + (16, 0, 'blooddps', 6, 'spell_deathknight_bloodpresence'), + (17, 0, 'frostdps', 6, 'spell_deathknight_frostpresence'), + (18, 0, 'frosttank', 6, 'spell_deathknight_frostpresence'), + (19, 0, 'unholydps', 6, 'spell_deathknight_unholypresence'), + (20, 0, 'elem', 7, 'spell_nature_lightning'), + (21, 0, 'enhance', 7, 'spell_nature_lightningshield'), + (22, 0, 'resto', 7, 'spell_nature_magicimmunity'), + (23, 0, 'arcane', 8, 'spell_holy_magicalsentry'), + (24, 0, 'fire', 8, 'spell_fire_firebolt02'), + (25, 0, 'frost', 8, 'spell_frost_frostbolt02'), + (26, 0, 'afflic', 9, 'spell_shadow_deathcoil'), + (27, 0, 'demo', 9, 'spell_shadow_metamorphosis'), + (28, 0, 'destro', 9, 'spell_shadow_rainoffire'), + (29, 0, 'balance', 11, 'spell_nature_starfall'), + (30, 0, 'feraltank', 11, 'ability_racial_bearform'), + (31, 0, 'resto', 11, 'spell_nature_healingtouch'), + (32, 0, 'feraldps', 11, 'ability_druid_catform'); + +DROP TABLE IF EXISTS `aowow_account_weightscale_data`; +CREATE TABLE IF NOT EXISTS `aowow_account_weightscale_data` ( + `id` int(32) NOT NULL, + `field` varchar(15) NOT NULL, + `val` smallint(6) unsigned NOT NULL, + KEY `id` (`id`), + CONSTRAINT `FK_acc_weightscales` FOREIGN KEY (`id`) REFERENCES `aowow_account_weightscales` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `aowow_account_weightscale_data` (`id`, `field`, `val`) VALUES + (2, 'exprtng', 100), + (2, 'str', 82), + (2, 'critstrkrtng', 66), + (2, 'agi', 53), + (2, 'armorpenrtng', 52), + (2, 'hitrtng', 48), + (2, 'hastertng', 36), + (2, 'atkpwr', 31), + (2, 'armor', 5), + (3, 'sta', 100), + (3, 'dodgertng', 90), + (3, 'defrtng', 86), + (3, 'block', 81), + (3, 'agi', 67), + (3, 'parryrtng', 67), + (3, 'blockrtng', 48), + (3, 'str', 48), + (3, 'exprtng', 19), + (3, 'hitrtng', 10), + (3, 'armorpenrtng', 10), + (3, 'critstrkrtng', 7), + (3, 'armor', 6), + (3, 'hastertng', 1), + (3, 'atkpwr', 1), + (4, 'int', 100), + (4, 'manargn', 88), + (4, 'splpwr', 58), + (4, 'critstrkrtng', 46), + (4, 'hastertng', 35), + (5, 'sta', 100), + (5, 'dodgertng', 94), + (5, 'block', 86), + (5, 'defrtng', 86), + (5, 'exprtng', 79), + (5, 'agi', 76), + (5, 'parryrtng', 76), + (5, 'hitrtng', 58), + (5, 'blockrtng', 52), + (5, 'str', 50), + (5, 'armor', 6), + (5, 'atkpwr', 6), + (5, 'splpwr', 4), + (5, 'critstrkrtng', 3), + (6, 'mledps', 470), + (6, 'hitrtng', 100), + (6, 'str', 80), + (6, 'exprtng', 66), + (6, 'critstrkrtng', 40), + (6, 'atkpwr', 34), + (6, 'agi', 32), + (6, 'hastertng', 30), + (6, 'armorpenrtng', 22), + (6, 'splpwr', 9), + (7, 'rgddps', 213), + (7, 'hitrtng', 100), + (7, 'agi', 58), + (7, 'critstrkrtng', 40), + (7, 'int', 37), + (7, 'atkpwr', 30), + (7, 'armorpenrtng', 28), + (7, 'hastertng', 21), + (8, 'rgddps', 379), + (8, 'hitrtng', 100), + (8, 'agi', 74), + (8, 'critstrkrtng', 57), + (8, 'armorpenrtng', 40), + (8, 'int', 39), + (8, 'atkpwr', 32), + (8, 'hastertng', 24), + (9, 'rgddps', 181), + (9, 'hitrtng', 100), + (9, 'agi', 76), + (9, 'critstrkrtng', 42), + (9, 'int', 35), + (9, 'hastertng', 31), + (9, 'atkpwr', 29), + (9, 'armorpenrtng', 26), + (10, 'mledps', 170), + (10, 'agi', 100), + (10, 'exprtng', 87), + (10, 'hitrtng', 83), + (10, 'critstrkrtng', 81), + (10, 'atkpwr', 65), + (10, 'armorpenrtng', 65), + (10, 'hastertng', 64), + (10, 'str', 55), + (11, 'mledps', 220), + (11, 'armorpenrtng', 100), + (11, 'agi', 100), + (11, 'exprtng', 82), + (11, 'hitrtng', 80), + (11, 'critstrkrtng', 75), + (11, 'hastertng', 73), + (11, 'str', 55), + (11, 'atkpwr', 50), + (12, 'mledps', 228), + (12, 'exprtng', 100), + (12, 'agi', 100), + (12, 'hitrtng', 80), + (12, 'armorpenrtng', 75), + (12, 'critstrkrtng', 75), + (12, 'hastertng', 75), + (12, 'str', 55), + (12, 'atkpwr', 50), + (13, 'splpwr', 100), + (13, 'manargn', 67), + (13, 'int', 65), + (13, 'hastertng', 59), + (13, 'critstrkrtng', 48), + (13, 'spi', 22), + (14, 'manargn', 100), + (14, 'int', 69), + (14, 'splpwr', 60), + (14, 'spi', 52), + (14, 'critstrkrtng', 38), + (14, 'hastertng', 31), + (15, 'hitrtng', 100), + (15, 'shasplpwr', 76), + (15, 'splpwr', 76), + (15, 'critstrkrtng', 54), + (15, 'hastertng', 50), + (15, 'spi', 16), + (15, 'int', 16), + (16, 'mledps', 360), + (16, 'armorpenrtng', 100), + (16, 'str', 99), + (16, 'hitrtng', 91), + (16, 'exprtng', 90), + (16, 'critstrkrtng', 57), + (16, 'hastertng', 55), + (16, 'atkpwr', 36), + (16, 'armor', 1), + (17, 'mledps', 337), + (17, 'hitrtng', 100), + (17, 'str', 97), + (17, 'exprtng', 81), + (17, 'armorpenrtng', 61), + (17, 'critstrkrtng', 45), + (17, 'atkpwr', 35), + (17, 'hastertng', 28), + (17, 'armor', 1), + (18, 'mledps', 419), + (18, 'parryrtng', 100), + (18, 'hitrtng', 97), + (18, 'str', 96), + (18, 'defrtng', 85), + (18, 'exprtng', 69), + (18, 'dodgertng', 61), + (18, 'agi', 61), + (18, 'sta', 61), + (18, 'critstrkrtng', 49), + (18, 'atkpwr', 41), + (18, 'armorpenrtng', 31), + (18, 'armor', 5), + (19, 'mledps', 209), + (19, 'str', 100), + (19, 'hitrtng', 66), + (19, 'exprtng', 51), + (19, 'hastertng', 48), + (19, 'critstrkrtng', 45), + (19, 'atkpwr', 34), + (19, 'armorpenrtng', 32), + (19, 'armor', 1), + (20, 'hitrtng', 100), + (20, 'splpwr', 60), + (20, 'hastertng', 56), + (20, 'critstrkrtng', 40), + (20, 'int', 11), + (21, 'mledps', 135), + (21, 'hitrtng', 100), + (21, 'exprtng', 84), + (21, 'agi', 55), + (21, 'int', 55), + (21, 'critstrkrtng', 55), + (21, 'hastertng', 42), + (21, 'str', 35), + (21, 'atkpwr', 32), + (21, 'splpwr', 29), + (21, 'armorpenrtng', 26), + (22, 'manargn', 100), + (22, 'int', 85), + (22, 'splpwr', 77), + (22, 'critstrkrtng', 62), + (22, 'hastertng', 35), + (23, 'hitrtng', 100), + (23, 'hastertng', 54), + (23, 'arcsplpwr', 49), + (23, 'splpwr', 49), + (23, 'critstrkrtng', 37), + (23, 'int', 34), + (23, 'frosplpwr', 24), + (23, 'firsplpwr', 24), + (23, 'spi', 14), + (24, 'hitrtng', 100), + (24, 'hastertng', 53), + (24, 'firsplpwr', 46), + (24, 'splpwr', 46), + (24, 'critstrkrtng', 43), + (24, 'frosplpwr', 23), + (24, 'arcsplpwr', 23), + (24, 'int', 13), + (25, 'hitrtng', 100), + (25, 'hastertng', 42), + (25, 'frosplpwr', 39), + (25, 'splpwr', 39), + (25, 'arcsplpwr', 19), + (25, 'firsplpwr', 19), + (25, 'critstrkrtng', 19), + (25, 'int', 6), + (26, 'hitrtng', 100), + (26, 'shasplpwr', 72), + (26, 'splpwr', 72), + (26, 'hastertng', 61), + (26, 'critstrkrtng', 38), + (26, 'firsplpwr', 36), + (26, 'spi', 34), + (26, 'int', 15), + (27, 'hitrtng', 100), + (27, 'hastertng', 50), + (27, 'firsplpwr', 45), + (27, 'shasplpwr', 45), + (27, 'splpwr', 45), + (27, 'critstrkrtng', 31), + (27, 'spi', 29), + (27, 'int', 13), + (28, 'hitrtng', 100), + (28, 'firsplpwr', 47), + (28, 'splpwr', 47), + (28, 'hastertng', 46), + (28, 'spi', 26), + (28, 'shasplpwr', 23), + (28, 'critstrkrtng', 16), + (28, 'int', 13), + (29, 'hitrtng', 100), + (29, 'splpwr', 66), + (29, 'hastertng', 54), + (29, 'critstrkrtng', 43), + (29, 'spi', 22), + (29, 'int', 22), + (30, 'agi', 100), + (30, 'sta', 75), + (30, 'dodgertng', 65), + (30, 'defrtng', 60), + (30, 'exprtng', 16), + (30, 'str', 10), + (30, 'armor', 10), + (30, 'hitrtng', 8), + (30, 'hastertng', 5), + (30, 'atkpwr', 4), + (30, 'feratkpwr', 4), + (30, 'critstrkrtng', 3), + (31, 'splpwr', 100), + (31, 'manargn', 73), + (31, 'hastertng', 57), + (31, 'int', 51), + (31, 'spi', 32), + (31, 'critstrkrtng', 11), + (32, 'agi', 100), + (32, 'armorpenrtng', 90), + (32, 'str', 80), + (32, 'critstrkrtng', 55), + (32, 'exprtng', 50), + (32, 'hitrtng', 50), + (32, 'feratkpwr', 40), + (32, 'atkpwr', 40), + (32, 'hastertng', 35); + +-- add cascading to comments +DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_comments c ON c.id = r.commentId WHERE c.Id IS NULL; +DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_account a ON a.id = r.userId WHERE a.Id IS NULL; + +ALTER TABLE `aowow_comments` + ENGINE=InnoDB, + CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Comment ID' FIRST, + CHANGE COLUMN `replyTo` `replyTo` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Reply To, comment ID' AFTER `flags`, + CHANGE COLUMN `userId` `userId` INT(10) UNSIGNED NULL COMMENT 'User ID' AFTER `typeId`, + ADD CONSTRAINT `FK_acc_co` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE `aowow_comments_rates` + ENGINE=InnoDB, + ADD CONSTRAINT `FK_acc_co_rate` FOREIGN KEY (`commentId`) REFERENCES `aowow_comments` (`id`) ON UPDATE CASCADE ON DELETE CASCADE, + ADD CONSTRAINT `FK_acc_co_rate_user` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION; + +-- auto-create datasets/weight-presets +UPDATE `aowow_dbversion` SET `build` = CONCAT(`build`, ' weightPresets'); + +SET FOREIGN_KEY_CHECKS=1; diff --git a/setup/updates/1484926142_01.sql b/setup/updates/1484926142_01.sql index 5f34728c..0edaae9f 100644 --- a/setup/updates/1484926142_01.sql +++ b/setup/updates/1484926142_01.sql @@ -1,8 +1,8 @@ -ALTER TABLE `aowow_home_featuredbox` - CHANGE COLUMN `active` `startDate` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `editDate`, - ADD COLUMN `endDate` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `startDate`; - -ALTER TABLE `aowow_home_featuredbox` - CHANGE COLUMN `bgImgUrl` `boxBG` VARCHAR(150) NULL DEFAULT NULL AFTER `extraWide`, - ADD COLUMN `altHomeLogo` VARCHAR(150) NULL DEFAULT NULL AFTER `boxBG`, - ADD COLUMN `altHeaderLogo` VARCHAR(150) NULL DEFAULT NULL AFTER `altHomeLogo`; +ALTER TABLE `aowow_home_featuredbox` + CHANGE COLUMN `active` `startDate` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `editDate`, + ADD COLUMN `endDate` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `startDate`; + +ALTER TABLE `aowow_home_featuredbox` + CHANGE COLUMN `bgImgUrl` `boxBG` VARCHAR(150) NULL DEFAULT NULL AFTER `extraWide`, + ADD COLUMN `altHomeLogo` VARCHAR(150) NULL DEFAULT NULL AFTER `boxBG`, + ADD COLUMN `altHeaderLogo` VARCHAR(150) NULL DEFAULT NULL AFTER `altHomeLogo`; diff --git a/setup/updates/1486948902_01.sql b/setup/updates/1486948902_01.sql index b89e5ab3..968647d2 100644 --- a/setup/updates/1486948902_01.sql +++ b/setup/updates/1486948902_01.sql @@ -1 +1 @@ -UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' currencies'); +UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' currencies'); diff --git a/setup/updates/1488061468_01.sql b/setup/updates/1488061468_01.sql index 00c066ce..93f47c30 100644 --- a/setup/updates/1488061468_01.sql +++ b/setup/updates/1488061468_01.sql @@ -1,4 +1,4 @@ -UPDATE aowow_races SET factionId = 69 WHERE id = 4; -- was 96 *sigh* +UPDATE aowow_races SET factionId = 69 WHERE id = 4; UPDATE aowow_creature SET cuFlags = cuFlags | 0x40000000 WHERE name_loc0 LIKE '%[%' OR diff --git a/setup/updates/1489291710_01.sql b/setup/updates/1489291710_01.sql index ac9ccdd3..2f2635c4 100644 --- a/setup/updates/1489291710_01.sql +++ b/setup/updates/1489291710_01.sql @@ -1,6 +1,6 @@ ALTER TABLE `aowow_spawns` - ALTER `type` DROP DEFAULT; + ALTER `type` DROP DEFAULT; ALTER TABLE `aowow_spawns` - CHANGE COLUMN `type` `type` SMALLINT UNSIGNED NOT NULL AFTER `guid`; + CHANGE COLUMN `type` `type` SMALLINT UNSIGNED NOT NULL AFTER `guid`; UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' spawns'); diff --git a/setup/updates/1489942886_01.sql b/setup/updates/1489942886_01.sql index b90ecf35..548137ba 100644 --- a/setup/updates/1489942886_01.sql +++ b/setup/updates/1489942886_01.sql @@ -1,7 +1,7 @@ ALTER TABLE `aowow_articles` CHANGE COLUMN `type` `type` SMALLINT(5) NULL DEFAULT NULL FIRST, CHANGE COLUMN `typeId` `typeId` MEDIUMINT(9) NULL DEFAULT NULL AFTER `type`, - CHANGE COLUMN `locale` `locale` TINYINT(4) UNSIGNED NOT NULL AFTER `typeId`, + CHANGE COLUMN `locale` `locale` TINYINT(4) UNSIGNED NOT NULL AFTER `typeId`, ADD COLUMN `url` VARCHAR(50) NULL DEFAULT NULL AFTER `locale`, - ADD COLUMN `editAccess` SMALLINT UNSIGNED NOT NULL DEFAULT '2' AFTER `url`, + ADD COLUMN `editAccess` SMALLINT UNSIGNED NOT NULL DEFAULT '2' AFTER `url`, ADD UNIQUE INDEX `locale_url` (`locale`, `url`);