From 84643ce9a15d4bafde69dd29e48d5a497cad3838 Mon Sep 17 00:00:00 2001 From: Uleat Date: Mon, 22 Oct 2018 22:27:05 -0400 Subject: [PATCH] Inventory update work-around [ci skip] --- utils/sql/db_update_manifest.txt | 4 +- .../required/2018_08_13_inventory_update.sql | 63 +++++++++++++++++++ .../2018_08_13_inventory_version_update.sql | 60 ------------------ 3 files changed, 65 insertions(+), 62 deletions(-) diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index dae319641..587839291 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -381,8 +381,8 @@ 9125|2018_07_20_task_emote.sql|SHOW COLUMNS FROM `tasks` LIKE 'completion_emote'|empty| 9126|2018_09_07_FastRegen.sql|SHOW COLUMNS FROM `zone` LIKE 'fast_regen_hp'|empty| 9127|2018_09_07_NPCMaxAggroDist.sql|SHOW COLUMNS FROM `zone` LIKE 'npc_max_aggro_dist'|empty| -9128|2018_08_13_inventory_version_update.sql|SHOW TABLES LIKE 'inventory_versions'|empty| -9129|2018_08_13_inventory_update.sql|SELECT * FROM `inventory_versions` WHERE `version` = 2 and `step` = 0|not_empty| +9128|2018_08_13_inventory_version_update.sql|SHOW TABLES LIKE 'inventory_version'|not_empty| +9129|2018_08_13_inventory_update.sql|SHOW TABLES LIKE 'inventory_versions'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2018_08_13_inventory_update.sql b/utils/sql/git/required/2018_08_13_inventory_update.sql index e02bc3ae0..4aeee6806 100644 --- a/utils/sql/git/required/2018_08_13_inventory_update.sql +++ b/utils/sql/git/required/2018_08_13_inventory_update.sql @@ -1,3 +1,66 @@ +DROP TABLE IF EXISTS `inventory_versions`; +DROP TABLE IF EXISTS `inventory_snapshots`; + + +CREATE TABLE `inventory_versions` ( + `version` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `step` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `bot_step` INT(11) UNSIGNED NOT NULL DEFAULT '0' +) +COLLATE='latin1_swedish_ci' +ENGINE=MyISAM; + +INSERT INTO `inventory_versions` VALUES (2, 0, 0); + + +CREATE TABLE `inventory_snapshots` ( + `time_index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `charid` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `slotid` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `itemid` INT(11) UNSIGNED NULL DEFAULT '0', + `charges` SMALLINT(3) UNSIGNED NULL DEFAULT '0', + `color` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot5` MEDIUMINT(7) UNSIGNED NULL DEFAULT '0', + `augslot6` MEDIUMINT(7) NOT NULL DEFAULT '0', + `instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `custom_data` TEXT NULL, + `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `ornament_hero_model` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`time_index`, `charid`, `slotid`) +) +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB; + + +CREATE TABLE `inventory_snapshots_v1_bak` ( + `time_index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `charid` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `slotid` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `itemid` INT(11) UNSIGNED NULL DEFAULT '0', + `charges` SMALLINT(3) UNSIGNED NULL DEFAULT '0', + `color` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', + `augslot5` MEDIUMINT(7) UNSIGNED NULL DEFAULT '0', + `augslot6` MEDIUMINT(7) NOT NULL DEFAULT '0', + `instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `custom_data` TEXT NULL, + `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `ornament_hero_model` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`time_index`, `charid`, `slotid`) +) +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB; + + -- create inventory v1 backup SELECT @pre_timestamp := UNIX_TIMESTAMP(NOW()); INSERT INTO `inventory_snapshots_v1_bak` diff --git a/utils/sql/git/required/2018_08_13_inventory_version_update.sql b/utils/sql/git/required/2018_08_13_inventory_version_update.sql index f8fc33162..942544544 100644 --- a/utils/sql/git/required/2018_08_13_inventory_version_update.sql +++ b/utils/sql/git/required/2018_08_13_inventory_version_update.sql @@ -1,61 +1 @@ DROP TABLE IF EXISTS `inventory_version`; -DROP TABLE IF EXISTS `inventory_snapshots`; - - -CREATE TABLE `inventory_versions` ( - `version` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `step` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `bot_step` INT(11) UNSIGNED NOT NULL DEFAULT '0' -) -COLLATE='latin1_swedish_ci' -ENGINE=MyISAM; - -INSERT INTO `inventory_versions` VALUES (2, 0, 0); - - -CREATE TABLE `inventory_snapshots` ( - `time_index` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `charid` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `slotid` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `itemid` INT(11) UNSIGNED NULL DEFAULT '0', - `charges` SMALLINT(3) UNSIGNED NULL DEFAULT '0', - `color` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot5` MEDIUMINT(7) UNSIGNED NULL DEFAULT '0', - `augslot6` MEDIUMINT(7) NOT NULL DEFAULT '0', - `instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - `custom_data` TEXT NULL, - `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `ornament_hero_model` INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`time_index`, `charid`, `slotid`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB; - - -CREATE TABLE `inventory_snapshots_v1_bak` ( - `time_index` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `charid` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `slotid` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `itemid` INT(11) UNSIGNED NULL DEFAULT '0', - `charges` SMALLINT(3) UNSIGNED NULL DEFAULT '0', - `color` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `augslot1` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot2` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot3` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot4` MEDIUMINT(7) UNSIGNED NOT NULL DEFAULT '0', - `augslot5` MEDIUMINT(7) UNSIGNED NULL DEFAULT '0', - `augslot6` MEDIUMINT(7) NOT NULL DEFAULT '0', - `instnodrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', - `custom_data` TEXT NULL, - `ornamenticon` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `ornamentidfile` INT(11) UNSIGNED NOT NULL DEFAULT '0', - `ornament_hero_model` INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`time_index`, `charid`, `slotid`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB;