From e3c8b7525924b82310851b0b6e441c52a0bc0420 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 15 Feb 2017 07:42:17 -0500 Subject: [PATCH] Moved bot spell entries out of npc spell entries (easier to manage bot changes by committing to non-bot manifest) --- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + .../2017_02_15_bot_spells_entries.sql | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 utils/sql/git/required/2017_02_15_bot_spells_entries.sql diff --git a/common/version.h b/common/version.h index 7afe02279..88f986807 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9104 +#define CURRENT_BINARY_DATABASE_VERSION 9105 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9008 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 98dc22fc1..c21f60f4b 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -358,6 +358,7 @@ 9102|2017_01_10_book_languages.sql|SHOW COLUMNS FROM `books` LIKE 'language'|empty| 9103|2017_01_30_book_languages_fix.sql|SELECT `language` from `books` WHERE `language` IS NULL|not_empty| 9104|2017_02_09_npc_spells_entries_type_update.sql|SHOW COLUMNS IN `npc_spells_entries` LIKE `type`|contains|smallint(5) unsigned +9105|2017_02_15_bot_spells_entries.sql|SELECT `id` FROM `npc_spells_entries` WHERE `npc_spells_id` >= 701 AND `npc_spells_id` <= 712|not_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/2017_02_15_bot_spells_entries.sql b/utils/sql/git/required/2017_02_15_bot_spells_entries.sql new file mode 100644 index 000000000..7f3a73d98 --- /dev/null +++ b/utils/sql/git/required/2017_02_15_bot_spells_entries.sql @@ -0,0 +1,31 @@ +-- Delete any existing `bots_spells_entries` table +DROP TABLE IF EXISTS `bots_spells_entries`; + +-- Create new bot spells entries table (new table does not have spells_id_spellid constraint) +CREATE TABLE `bot_spells_entries` ( + `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `npc_spells_id` INT(11) NOT NULL DEFAULT '0', + `spellid` SMALLINT(5) NOT NULL DEFAULT '0', + `type` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `minlevel` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + `maxlevel` TINYINT(3) UNSIGNED NOT NULL DEFAULT '255', + `manacost` SMALLINT(5) NOT NULL DEFAULT '-1', + `recast_delay` INT(11) NOT NULL DEFAULT '-1', + `priority` SMALLINT(5) NOT NULL DEFAULT '0', + `resist_adjust` INT(11) NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB +AUTO_INCREMENT=1 +; + +-- Copy bots spells into new table +INSERT INTO `bot_spells_entries` (`npc_spells_id`, `spellid`, `type`, `minlevel`, `maxlevel`, `manacost`, `recast_delay`, `priority`, `resist_adjust`) +SELECT `npc_spells_id`, `spellid`, `type`, `minlevel`, `maxlevel`, `manacost`, `recast_delay`, `priority`, `resist_adjust` +FROM `npc_spells_entries` WHERE `npc_spells_id` >= '701' AND `npc_spells_id` <= '712'; + +-- Delete bot spells from old table +DELETE FROM `npc_spells_entries` WHERE `npc_spells_id` >= '701' AND `npc_spells_id` <= '712'; + +-- Admins can remove this new table if they are 100% certain they will never use bots