diff --git a/common/version.h b/common/version.h index f59138975..cdc25f33b 100644 --- a/common/version.h +++ b/common/version.h @@ -37,7 +37,7 @@ #define CURRENT_BINARY_DATABASE_VERSION 9212 #ifdef BOTS - #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9030 + #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9031 #else #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #endif diff --git a/utils/sql/git/bots/bots_db_update_manifest.txt b/utils/sql/git/bots/bots_db_update_manifest.txt index bd8064e30..5c13e914c 100644 --- a/utils/sql/git/bots/bots_db_update_manifest.txt +++ b/utils/sql/git/bots/bots_db_update_manifest.txt @@ -29,6 +29,7 @@ 9028|2021_06_04_bot_create_combinations.sql|SHOW TABLES LIKE 'bot_create_combinations'|empty| 9029|2022_06_21_bot_groups_auto_spawn.sql|SHOW COLUMNS from `bot_groups` LIKE 'auto_spawm'|empty| 9030|2022_10_27_bot_data_buckets.sql|SHOW COLUMNS FROM `bot_spells_entries` LIKE 'bucket_name'|empty| +9031|2022_11_13_bot_spells_entries.sql|SELECT * FROM db_version WHERE bots_version >= 9031|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/bots/required/2022_11_13_bot_spells_entries.sql b/utils/sql/git/bots/required/2022_11_13_bot_spells_entries.sql new file mode 100644 index 000000000..6d60e216f --- /dev/null +++ b/utils/sql/git/bots/required/2022_11_13_bot_spells_entries.sql @@ -0,0 +1,10 @@ +UPDATE bot_spells_entries SET bucket_comparison = 0 WHERE bucket_comparison IS NULL; +UPDATE bot_spells_entries SET min_hp = 0 WHERE min_hp IS NULL; +UPDATE bot_spells_entries SET max_hp = 0 WHERE max_hp IS NULL; +UPDATE bot_spells_entries SET resist_adjust = 0 WHERE resist_adjust IS NULL; + +ALTER TABLE `bot_spells_entries` +MODIFY COLUMN `resist_adjust` int(11) NOT NULL DEFAULT 0 AFTER `priority`, +MODIFY COLUMN `min_hp` smallint(5) NOT NULL DEFAULT 0 AFTER `resist_adjust`, +MODIFY COLUMN `max_hp` smallint(5) NOT NULL DEFAULT 0 AFTER `min_hp`, +MODIFY COLUMN `bucket_comparison` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `bucket_value`;