From 55b43c67519359f0e5a96004c393898b3c62add3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 27 Sep 2014 22:40:58 -0230 Subject: Core/LootMgr: Update lootMgr to normalize loot_template tables --- sql/updates/world/2014_09_27_03_world.sql | 179 ++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sql/updates/world/2014_09_27_03_world.sql (limited to 'sql') diff --git a/sql/updates/world/2014_09_27_03_world.sql b/sql/updates/world/2014_09_27_03_world.sql new file mode 100644 index 00000000000..d5fd075db3a --- /dev/null +++ b/sql/updates/world/2014_09_27_03_world.sql @@ -0,0 +1,179 @@ +-- Alter creature_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" +ALTER TABLE `creature_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `creature_loot_template` DROP PRIMARY KEY; +ALTER TABLE `creature_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `creature_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `creature_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `creature_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `creature_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `creature_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `creature_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `creature_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `creature_loot_template` DROP `mincountOrRef`; +ALTER TABLE `creature_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter disenchant_loot_template +ALTER TABLE `disenchant_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `disenchant_loot_template` DROP PRIMARY KEY; +ALTER TABLE `disenchant_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `disenchant_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `disenchant_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `disenchant_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `disenchant_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `disenchant_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `disenchant_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `disenchant_loot_template` DROP `mincountOrRef`; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter fishing_loot_template +ALTER TABLE `fishing_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `fishing_loot_template` DROP PRIMARY KEY; +ALTER TABLE `fishing_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `fishing_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `fishing_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `fishing_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `fishing_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `fishing_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `fishing_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `fishing_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `fishing_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `fishing_loot_template` DROP `mincountOrRef`; +ALTER TABLE `fishing_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter gameobject_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" +ALTER TABLE `gameobject_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `gameobject_loot_template` DROP PRIMARY KEY; +ALTER TABLE `gameobject_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `gameobject_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `gameobject_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `gameobject_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `gameobject_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `gameobject_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `gameobject_loot_template` DROP `mincountOrRef`; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter item_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" +ALTER TABLE `item_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `item_loot_template` DROP PRIMARY KEY; +ALTER TABLE `item_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `item_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `item_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `item_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `item_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `item_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `item_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `item_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `item_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `item_loot_template` DROP `mincountOrRef`; +ALTER TABLE `item_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter mail_loot_template +ALTER TABLE `mail_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `mail_loot_template` DROP PRIMARY KEY; +ALTER TABLE `mail_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `mail_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `mail_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `mail_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `mail_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `mail_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `mail_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `mail_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `mail_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `mail_loot_template` DROP `mincountOrRef`; +ALTER TABLE `mail_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter milling_loot_template +ALTER TABLE `milling_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `milling_loot_template` DROP PRIMARY KEY; +ALTER TABLE `milling_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `milling_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `milling_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `milling_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `milling_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `milling_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `milling_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `milling_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `milling_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `milling_loot_template` DROP `mincountOrRef`; +ALTER TABLE `milling_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter pickpocketing_loot_template +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `pickpocketing_loot_template` DROP PRIMARY KEY; +ALTER TABLE `pickpocketing_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `pickpocketing_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `pickpocketing_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `pickpocketing_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `pickpocketing_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `pickpocketing_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `pickpocketing_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `pickpocketing_loot_template` DROP `mincountOrRef`; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter prospecting_loot_template +ALTER TABLE `prospecting_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `prospecting_loot_template` DROP PRIMARY KEY; +ALTER TABLE `prospecting_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `prospecting_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `prospecting_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `prospecting_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `prospecting_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `prospecting_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `prospecting_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `prospecting_loot_template` DROP `mincountOrRef`; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter reference_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" +ALTER TABLE `reference_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `reference_loot_template` DROP PRIMARY KEY; +ALTER TABLE `reference_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `reference_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `reference_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `reference_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `reference_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `reference_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `reference_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `reference_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `reference_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `reference_loot_template` DROP `mincountOrRef`; +ALTER TABLE `reference_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter skinning_loot_template +ALTER TABLE `skinning_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `skinning_loot_template` DROP PRIMARY KEY; +ALTER TABLE `skinning_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `skinning_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `skinning_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `skinning_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `skinning_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `skinning_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `skinning_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `skinning_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `skinning_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `skinning_loot_template` DROP `mincountOrRef`; +ALTER TABLE `skinning_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; + +-- Alter spell_loot_template +ALTER TABLE `spell_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +ALTER TABLE `spell_loot_template` DROP PRIMARY KEY; +ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); +UPDATE `spell_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `spell_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; +ALTER TABLE `spell_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `spell_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `spell_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `spell_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; +ALTER TABLE `spell_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; +UPDATE `spell_loot_template` SET `mincount` = `mincountOrRef`; +ALTER TABLE `spell_loot_template` DROP `mincountOrRef`; +ALTER TABLE `spell_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; -- cgit v1.2.3 From 0d92b4cc1534b58c087b63530f1dbfa5a8874047 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 27 Sep 2014 22:46:07 -0230 Subject: DB/Loot: Update SQL --- sql/updates/world/2014_09_27_03_world.sql | 334 +++++++++++++++++------------- 1 file changed, 185 insertions(+), 149 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2014_09_27_03_world.sql b/sql/updates/world/2014_09_27_03_world.sql index d5fd075db3a..d9345f09205 100644 --- a/sql/updates/world/2014_09_27_03_world.sql +++ b/sql/updates/world/2014_09_27_03_world.sql @@ -1,179 +1,215 @@ --- Alter creature_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" -ALTER TABLE `creature_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +-- Alter creature_loot_template ALTER TABLE `creature_loot_template` DROP PRIMARY KEY; -ALTER TABLE `creature_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `creature_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `creature_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `creature_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `creature_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `creature_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `creature_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `creature_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `creature_loot_template` DROP `mincountOrRef`; -ALTER TABLE `creature_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `creature_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `creature_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `creature_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `creature_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `creature_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `creature_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `creature_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `creature_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `creature_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `creature_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `creature_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `creature_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `creature_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `creature_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter disenchant_loot_template -ALTER TABLE `disenchant_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `disenchant_loot_template` DROP PRIMARY KEY; -ALTER TABLE `disenchant_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `disenchant_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `disenchant_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `disenchant_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `disenchant_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `disenchant_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `disenchant_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `disenchant_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `disenchant_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `disenchant_loot_template` DROP `mincountOrRef`; -ALTER TABLE `disenchant_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `disenchant_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `disenchant_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `disenchant_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `disenchant_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `disenchant_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `disenchant_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `disenchant_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `disenchant_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `disenchant_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `disenchant_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `disenchant_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `disenchant_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter fishing_loot_template -ALTER TABLE `fishing_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `fishing_loot_template` DROP PRIMARY KEY; -ALTER TABLE `fishing_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `fishing_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `fishing_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `fishing_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `fishing_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `fishing_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `fishing_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `fishing_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `fishing_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `fishing_loot_template` DROP `mincountOrRef`; -ALTER TABLE `fishing_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `fishing_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `fishing_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `fishing_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `fishing_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `fishing_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `fishing_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `fishing_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `fishing_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `fishing_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `fishing_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `fishing_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `fishing_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `fishing_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `fishing_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `fishing_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); --- Alter gameobject_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" -ALTER TABLE `gameobject_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +-- Alter gameobject_loot_template ALTER TABLE `gameobject_loot_template` DROP PRIMARY KEY; -ALTER TABLE `gameobject_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `gameobject_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `gameobject_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `gameobject_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `gameobject_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `gameobject_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `gameobject_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `gameobject_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `gameobject_loot_template` DROP `mincountOrRef`; -ALTER TABLE `gameobject_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `gameobject_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `gameobject_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `gameobject_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `gameobject_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `gameobject_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `gameobject_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `gameobject_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `gameobject_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `gameobject_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `gameobject_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `gameobject_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); --- Alter item_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" -ALTER TABLE `item_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; +-- Alter item_loot_template ALTER TABLE `item_loot_template` DROP PRIMARY KEY; -ALTER TABLE `item_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `item_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `item_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `item_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `item_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `item_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `item_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `item_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `item_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `item_loot_template` DROP `mincountOrRef`; -ALTER TABLE `item_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `item_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `item_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `item_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `item_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `item_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `item_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `item_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `item_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `item_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `item_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `item_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `item_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `item_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `item_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `item_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter mail_loot_template -ALTER TABLE `mail_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `mail_loot_template` DROP PRIMARY KEY; -ALTER TABLE `mail_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `mail_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `mail_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `mail_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `mail_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `mail_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `mail_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `mail_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `mail_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `mail_loot_template` DROP `mincountOrRef`; -ALTER TABLE `mail_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `mail_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `mail_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `mail_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `mail_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `mail_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `mail_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `mail_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `mail_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `mail_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `mail_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `mail_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `mail_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `mail_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `mail_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `mail_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter milling_loot_template -ALTER TABLE `milling_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `milling_loot_template` DROP PRIMARY KEY; -ALTER TABLE `milling_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `milling_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `milling_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `milling_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `milling_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `milling_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `milling_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `milling_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `milling_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `milling_loot_template` DROP `mincountOrRef`; -ALTER TABLE `milling_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `milling_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `milling_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `milling_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `milling_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `milling_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `milling_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `milling_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `milling_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `milling_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `milling_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `milling_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `milling_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `milling_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `milling_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `milling_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter pickpocketing_loot_template -ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `pickpocketing_loot_template` DROP PRIMARY KEY; -ALTER TABLE `pickpocketing_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `pickpocketing_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `pickpocketing_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `pickpocketing_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `pickpocketing_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `pickpocketing_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `pickpocketing_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `pickpocketing_loot_template` DROP `mincountOrRef`; -ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `pickpocketing_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `pickpocketing_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `pickpocketing_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `pickpocketing_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `pickpocketing_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `pickpocketing_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `pickpocketing_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `pickpocketing_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `pickpocketing_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `pickpocketing_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `pickpocketing_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `pickpocketing_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter prospecting_loot_template -ALTER TABLE `prospecting_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `prospecting_loot_template` DROP PRIMARY KEY; -ALTER TABLE `prospecting_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `prospecting_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `prospecting_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `prospecting_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `prospecting_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `prospecting_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `prospecting_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `prospecting_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `prospecting_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `prospecting_loot_template` DROP `mincountOrRef`; -ALTER TABLE `prospecting_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `prospecting_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `prospecting_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `prospecting_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `prospecting_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `prospecting_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `prospecting_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `prospecting_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `prospecting_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `prospecting_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `prospecting_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `prospecting_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `prospecting_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); --- Alter reference_loot_template "Cannot set item to 0 for reference entries. Will get primary key error" -ALTER TABLE `reference_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; -ALTER TABLE `reference_loot_template` DROP PRIMARY KEY; -ALTER TABLE `reference_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `reference_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `reference_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `reference_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `reference_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `reference_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `reference_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `reference_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `reference_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `reference_loot_template` DROP `mincountOrRef`; -ALTER TABLE `reference_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +-- Alter Reference_loot_template +ALTER TABLE `Reference_loot_template` DROP PRIMARY KEY; +ALTER TABLE `Reference_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `Reference_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `Reference_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `Reference_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `Reference_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `Reference_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `Reference_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `Reference_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `Reference_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `Reference_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `Reference_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `Reference_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `Reference_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `Reference_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `Reference_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter skinning_loot_template -ALTER TABLE `skinning_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `skinning_loot_template` DROP PRIMARY KEY; -ALTER TABLE `skinning_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `skinning_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `skinning_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `skinning_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `skinning_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `skinning_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `skinning_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `skinning_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `skinning_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `skinning_loot_template` DROP `mincountOrRef`; -ALTER TABLE `skinning_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `skinning_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `skinning_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `skinning_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `skinning_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `skinning_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `skinning_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `skinning_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `skinning_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `skinning_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `skinning_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `skinning_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `skinning_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `skinning_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `skinning_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `skinning_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter spell_loot_template -ALTER TABLE `spell_loot_template` ADD COLUMN `reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `item`; ALTER TABLE `spell_loot_template` DROP PRIMARY KEY; -ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`entry`,`item`,`reference`); -UPDATE `spell_loot_template` SET `reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `spell_loot_template` SET `mincountOrRef` = 1 WHERE `reference` > 0; -ALTER TABLE `spell_loot_template` ADD COLUMN `needsquest` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `spell_loot_template` SET `needsquest` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `spell_loot_template` SET `ChanceOrQuestChance` = ChanceOrQuestChance * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `spell_loot_template` CHANGE `ChanceOrQuestChance` `chance` FLOAT; -ALTER TABLE `spell_loot_template` ADD COLUMN `mincount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1 AFTER `mincountOrRef`; -UPDATE `spell_loot_template` SET `mincount` = `mincountOrRef`; -ALTER TABLE `spell_loot_template` DROP `mincountOrRef`; -ALTER TABLE `spell_loot_template` ADD COLUMN `comment` VARCHAR(255) AFTER `maxcount`; +ALTER TABLE `spell_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `spell_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `spell_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `spell_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `spell_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `spell_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `spell_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `spell_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `spell_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `spell_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `spell_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `spell_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `spell_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); \ No newline at end of file -- cgit v1.2.3 From 8a7f06fe43f5d1cd4bbcc4c2ef4c4bd8efd2d15e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 27 Sep 2014 22:49:56 -0230 Subject: DB/Loot Template: If I put the updates sql in the right dir in the first place none of this would be happening... --- sql/updates/world/2014_09_27_03_world.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2014_09_27_03_world.sql b/sql/updates/world/2014_09_27_03_world.sql index d9345f09205..3a04ba46d8c 100644 --- a/sql/updates/world/2014_09_27_03_world.sql +++ b/sql/updates/world/2014_09_27_03_world.sql @@ -212,4 +212,4 @@ ALTER TABLE `spell_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; ALTER TABLE `spell_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; ALTER TABLE `spell_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; -ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); \ No newline at end of file +ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- cgit v1.2.3 From bcfc2911b477cc4597cfe2acb9ada23ff88ba2bc Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 28 Sep 2014 04:09:40 +0200 Subject: SQL: Fix sql import on unix --- sql/updates/world/2014_09_27_03_world.sql | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2014_09_27_03_world.sql b/sql/updates/world/2014_09_27_03_world.sql index 3a04ba46d8c..1810f488150 100644 --- a/sql/updates/world/2014_09_27_03_world.sql +++ b/sql/updates/world/2014_09_27_03_world.sql @@ -160,23 +160,23 @@ ALTER TABLE `prospecting_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) ALTER TABLE `prospecting_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; ALTER TABLE `prospecting_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); --- Alter Reference_loot_template -ALTER TABLE `Reference_loot_template` DROP PRIMARY KEY; -ALTER TABLE `Reference_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE `Reference_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE `Reference_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; -UPDATE `Reference_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; -UPDATE `Reference_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; -ALTER TABLE `Reference_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; -UPDATE `Reference_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; -UPDATE `Reference_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; -ALTER TABLE `Reference_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; -ALTER TABLE `Reference_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; -ALTER TABLE `Reference_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE `Reference_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; -ALTER TABLE `Reference_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; -ALTER TABLE `Reference_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; -ALTER TABLE `Reference_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); +-- Alter reference_loot_template +ALTER TABLE `reference_loot_template` DROP PRIMARY KEY; +ALTER TABLE `reference_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `reference_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `reference_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`; +UPDATE `reference_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0; +UPDATE `reference_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0; +ALTER TABLE `reference_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`; +UPDATE `reference_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0; +UPDATE `reference_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0; +ALTER TABLE `reference_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100; +ALTER TABLE `reference_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `reference_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `reference_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `reference_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `reference_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`; +ALTER TABLE `reference_loot_template` ADD PRIMARY KEY (`Entry`,`Item`); -- Alter skinning_loot_template ALTER TABLE `skinning_loot_template` DROP PRIMARY KEY; -- cgit v1.2.3