diff --git a/common/database/database_update_manifest.h b/common/database/database_update_manifest.h index e0a0281d7..5cbddf453 100644 --- a/common/database/database_update_manifest.h +++ b/common/database/database_update_manifest.h @@ -7207,6 +7207,25 @@ ALTER TABLE `character_parcels_containers` )", .content_schema_update = false }, + ManifestEntry{ + .version = 9329, + .description = "2026_04_27_spell_id_type_correction.sql", + .check = "SHOW COLUMNS FROM `character_spells` WHERE `Field` LIKE 'spell_id' AND `Type` LIKE 'int(%)'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `blocked_spells` MODIFY COLUMN `spellid` INTEGER NULL; +ALTER TABLE `character_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `character_memmed_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `character_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `damageshieldtypes` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `ldon_trap_templates` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE IF EXISTS `merc_buffs` MODIFY COLUMN `SpellId` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE IF EXISTS `merc_spell_list_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `npc_spells_entries` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `spell_buckets` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +)" + }, // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ // .version = 9228, diff --git a/common/database/database_update_manifest_bots.h b/common/database/database_update_manifest_bots.h index c73268a82..eebdae70f 100644 --- a/common/database/database_update_manifest_bots.h +++ b/common/database/database_update_manifest_bots.h @@ -2174,7 +2174,23 @@ FROM bot_settings WHERE `setting_id` = 0 AND `setting_type` = 0; )" - } + }, + ManifestEntry{ + .version = 9056, + .description = "some_new_migration.sql", + .check = "SHOW COLUMNS FROM `table_name` LIKE 'column_name'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `bot_blocked_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `bot_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_pet_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_pets` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_spell_settings` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_spells_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_timers` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +)" + }, // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ // .version = 9228, diff --git a/common/version.h b/common/version.h index 02f064096..91fbeb52e 100644 --- a/common/version.h +++ b/common/version.h @@ -38,6 +38,6 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9328 -#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9055 +#define CURRENT_BINARY_DATABASE_VERSION 9329 +#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9056 #define CUSTOM_BINARY_DATABASE_VERSION 0 diff --git a/utils/sql/merc_tables_bootstrap.sql b/utils/sql/merc_tables_bootstrap.sql index a527df283..463ca3ae0 100644 --- a/utils/sql/merc_tables_bootstrap.sql +++ b/utils/sql/merc_tables_bootstrap.sql @@ -73,7 +73,7 @@ CREATE TABLE `merc_buffs` ( `MercBuffId` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `MercId` int(10) UNSIGNED NOT NULL DEFAULT 0, - `SpellId` int(10) UNSIGNED NOT NULL DEFAULT 0, + `SpellId` int(10) NOT NULL DEFAULT 0, `CasterLevel` int(10) UNSIGNED NOT NULL DEFAULT 0, `DurationFormula` int(10) UNSIGNED NOT NULL DEFAULT 0, `TicsRemaining` int(11) NOT NULL DEFAULT 0, @@ -941,7 +941,7 @@ CREATE TABLE `merc_spell_list_entries` ( `merc_spell_list_entry_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `merc_spell_list_id` int(10) UNSIGNED NOT NULL, - `spell_id` int(10) UNSIGNED NOT NULL, + `spell_id` int(10) NOT NULL, `spell_type` int(10) UNSIGNED NOT NULL DEFAULT 0, `stance_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `minlevel` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,