From df1562e62cbab005829e4ccab304dabbeede0fba Mon Sep 17 00:00:00 2001 From: Cyberium Date: Mon, 19 Dec 2016 15:12:35 +0100 Subject: [PATCH] [12948] Fix database update workflow --- sql/base/mangos.sql | 2 +- ...condition.sql => 12948_01_mangos_areatrigger_teleport.sql} | 3 ++- sql/updates/mangos/12948_02_mangos_quest_template.sql | 3 +++ sql/updates/mangos/12948_03_mangos_npc_trainer.sql | 3 +++ sql/updates/mangos/12948_04_mangos_npc_trainer_template.sql | 3 +++ sql/updates/mangos/trainer_conditon_id.sql | 4 ---- src/shared/revision_sql.h | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) rename sql/updates/mangos/{areatriggerteleport_condition.sql => 12948_01_mangos_areatrigger_teleport.sql} (50%) create mode 100644 sql/updates/mangos/12948_02_mangos_quest_template.sql create mode 100644 sql/updates/mangos/12948_03_mangos_npc_trainer.sql create mode 100644 sql/updates/mangos/12948_04_mangos_npc_trainer_template.sql delete mode 100644 sql/updates/mangos/trainer_conditon_id.sql diff --git a/sql/base/mangos.sql b/sql/base/mangos.sql index 764661531d..62bc472e3c 100644 --- a/sql/base/mangos.sql +++ b/sql/base/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) DEFAULT NULL, `creature_ai_version` varchar(120) DEFAULT NULL, `cache_id` int(10) DEFAULT '0', - `required_12947_01_mangos_game_event` bit(1) DEFAULT NULL + `required_12948_04_mangos_npc_trainer_template` bit(1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Used DB version notes'; -- diff --git a/sql/updates/mangos/areatriggerteleport_condition.sql b/sql/updates/mangos/12948_01_mangos_areatrigger_teleport.sql similarity index 50% rename from sql/updates/mangos/areatriggerteleport_condition.sql rename to sql/updates/mangos/12948_01_mangos_areatrigger_teleport.sql index 96dd2b3eba..2e03ae64d4 100644 --- a/sql/updates/mangos/areatriggerteleport_condition.sql +++ b/sql/updates/mangos/12948_01_mangos_areatrigger_teleport.sql @@ -1,2 +1,3 @@ -ALTER TABLE areatrigger_teleport ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER target_orientation; +ALTER TABLE db_version CHANGE COLUMN required_12947_01_mangos_game_event required_12948_01_mangos_areatrigger_teleport bit; +ALTER TABLE areatrigger_teleport ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER target_orientation; diff --git a/sql/updates/mangos/12948_02_mangos_quest_template.sql b/sql/updates/mangos/12948_02_mangos_quest_template.sql new file mode 100644 index 0000000000..93ad987aee --- /dev/null +++ b/sql/updates/mangos/12948_02_mangos_quest_template.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_12948_01_mangos_areatrigger_teleport required_12948_02_mangos_quest_template bit; + +ALTER TABLE quest_template ADD COLUMN RequiredCondition INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER RequiredSkillValue; diff --git a/sql/updates/mangos/12948_03_mangos_npc_trainer.sql b/sql/updates/mangos/12948_03_mangos_npc_trainer.sql new file mode 100644 index 0000000000..ef3e572a71 --- /dev/null +++ b/sql/updates/mangos/12948_03_mangos_npc_trainer.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_12948_02_mangos_quest_template required_12948_03_mangos_npc_trainer bit; + +ALTER TABLE npc_trainer ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER reqlevel; diff --git a/sql/updates/mangos/12948_04_mangos_npc_trainer_template.sql b/sql/updates/mangos/12948_04_mangos_npc_trainer_template.sql new file mode 100644 index 0000000000..81f39a0220 --- /dev/null +++ b/sql/updates/mangos/12948_04_mangos_npc_trainer_template.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_12948_03_mangos_npc_trainer required_12948_04_mangos_npc_trainer_template bit; + +ALTER TABLE npc_trainer_template ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER reqlevel; diff --git a/sql/updates/mangos/trainer_conditon_id.sql b/sql/updates/mangos/trainer_conditon_id.sql deleted file mode 100644 index 55f15075fd..0000000000 --- a/sql/updates/mangos/trainer_conditon_id.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE npc_trainer ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER reqlevel; -ALTER TABLE npc_trainer_template ADD COLUMN `condition_id` INT(11) unsigned NOT NULL default '0' AFTER reqlevel; - - diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 4d30918130..41262bbef2 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -2,5 +2,5 @@ #define __REVISION_SQL_H__ #define REVISION_DB_REALMD "required_c12484_02_realmd_account_access" #define REVISION_DB_CHARACTERS "required_12942_01_characters_reset_talents" - #define REVISION_DB_MANGOS "required_12947_01_mangos_game_event" + #define REVISION_DB_MANGOS "required_12948_04_mangos_npc_trainer_template" #endif // __REVISION_SQL_H__