From 1c8dea909e3fbbdd77c757868db2240278de811c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 24 Jun 2017 21:11:46 -0500 Subject: [PATCH] New rules made by developers are now automatically created when world boots up, this keeps from having to issue schema SQL updates every time rules are added. - Whenever a rule isn't present in the database, it will be automatically created - utils/sql/git/required/2017_06_24_rule_values_expand.sql required for avoid floating point value inserts --- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + utils/sql/git/required/2017_06_24_rule_values_expand.sql | 2 ++ world/net.cpp | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 utils/sql/git/required/2017_06_24_rule_values_expand.sql diff --git a/common/version.h b/common/version.h index 40efffa5a..2391862a1 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 9111 +#define CURRENT_BINARY_DATABASE_VERSION 9112 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017 #else diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index fc97ffc1b..5586b9848 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -365,6 +365,7 @@ 9109|2017_04_08_doors_disable_timer.sql|SHOW COLUMNS FROM `doors` LIKE 'disable_timer'|empty| 9110|2017_04_10_graveyard.sql|show index from graveyard WHERE key_name = 'zone_id_nonunique'|empty| 9111|2017_06_24_saylink_index.sql|SHOW INDEX FROM `saylink` WHERE `key_name` = 'phrase_index'|empty| +9112|2017_06_24_rule_values_expand.sql|SHOW COLUMNS FROM rule_values WHERE Field = 'rule_value' and Type = 'varchar(30)'|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_06_24_rule_values_expand.sql b/utils/sql/git/required/2017_06_24_rule_values_expand.sql new file mode 100644 index 000000000..2d4720007 --- /dev/null +++ b/utils/sql/git/required/2017_06_24_rule_values_expand.sql @@ -0,0 +1,2 @@ +ALTER TABLE `rule_values` +MODIFY COLUMN `rule_value` varchar(30) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `rule_name`; diff --git a/world/net.cpp b/world/net.cpp index 09511c3f2..599f01c8f 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -332,6 +332,8 @@ int main(int argc, char** argv) { database.ClearMerchantTemp(); } + RuleManager::Instance()->SaveRules(&database); + Log(Logs::General, Logs::World_Server, "Loading EQ time of day.."); TimeOfDay_Struct eqTime; time_t realtime;