-- DB update 2023_04_22_00 -> 2023_04_23_00
-- convert mediumint to int
ALTER TABLE `character_aura` MODIFY `spell` INT UNSIGNED DEFAULT '0';
ALTER TABLE `character_pet` MODIFY `CreatedBySpell` INT UNSIGNED DEFAULT '0';
ALTER TABLE `character_spell` MODIFY `spell` INT UNSIGNED DEFAULT '0' COMMENT 'Spell Identifier';
ALTER TABLE `character_spell_cooldown` MODIFY `category` INT UNSIGNED DEFAULT '0';
ALTER TABLE `character_spell_cooldown` MODIFY `spell` INT UNSIGNED DEFAULT '0' COMMENT 'Spell Identifier';
ALTER TABLE `character_talent` MODIFY `spell` INT UNSIGNED NOT NULL;
ALTER TABLE `characters` MODIFY `latency` INT UNSIGNED DEFAULT '0';
ALTER TABLE `characters` MODIFY `transguid` INT DEFAULT '0';
ALTER TABLE `guild_rank` MODIFY `rights` INT UNSIGNED DEFAULT '0';
ALTER TABLE `item_instance` MODIFY `flags` INT UNSIGNED DEFAULT '0';
ALTER TABLE `item_instance` MODIFY `itemEntry` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pet_aura` MODIFY `amount0` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `amount1` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `amount2` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `base_amount0` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `base_amount1` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `base_amount2` INT DEFAULT NULL;
ALTER TABLE `pet_aura` MODIFY `spell` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pet_spell` MODIFY `spell` INT UNSIGNED DEFAULT '0' COMMENT 'Spell Identifier';
ALTER TABLE `pet_spell_cooldown` MODIFY `category` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pet_spell_cooldown` MODIFY `spell` INT UNSIGNED DEFAULT '0' COMMENT 'Spell Identifier';
ALTER TABLE `pvpstats_players` MODIFY `attr_1` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pvpstats_players` MODIFY `attr_2` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pvpstats_players` MODIFY `attr_3` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pvpstats_players` MODIFY `attr_4` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pvpstats_players` MODIFY `attr_5` INT UNSIGNED DEFAULT '0';
ALTER TABLE `pvpstats_players` MODIFY `score_bonus_honor` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `pvpstats_players` MODIFY `score_damage_done` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `pvpstats_players` MODIFY `score_deaths` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `pvpstats_players` MODIFY `score_healing_done` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `pvpstats_players` MODIFY `score_honorable_kills` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `pvpstats_players` MODIFY `score_killing_blows` INT UNSIGNED DEFAULT NULL;
ALTER TABLE `quest_tracker` MODIFY `id` INT UNSIGNED DEFAULT '0';
ALTER TABLE `recovery_item` MODIFY `ItemEntry` INT UNSIGNED DEFAULT '0';

-- Update engine, row format, charset and collation
ALTER TABLE `account_data` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `account_instance_times` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `account_tutorial` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `addons` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `arena_team` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `arena_team_member` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `auctionhouse` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `banned_addons` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `battleground_deserters` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `bugreport` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `calendar_events` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `calendar_invites` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `channels` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `channels_bans` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `channels_rights` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `characters` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_account_data` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_achievement` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_achievement_progress` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_action` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_arena_stats` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_aura` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_banned` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_battleground_random` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_brew_of_the_month` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_declinedname` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_entry_point` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_equipmentsets` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_gifts` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_glyphs` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_homebind` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_instance` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_inventory` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_pet` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_pet_declinedname` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus_daily` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus_monthly` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus_rewarded` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus_seasonal` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_queststatus_weekly` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_reputation` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_settings` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_skills` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_social` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_spell` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_spell_cooldown` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_stats` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `character_talent` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `corpse` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `creature_respawn` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `gameobject_respawn` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `game_event_condition_save` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `game_event_save` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `gm_subsurvey` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `gm_survey` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `gm_ticket` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `groups` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `group_member` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_bank_eventlog` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_bank_item` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_bank_right` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_bank_tab` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_eventlog` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_member` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_member_withdraw` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `guild_rank` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `instance` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `instance_reset` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `instance_saved_go_state_data` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `item_instance` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `item_loot_storage` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `item_refund_instance` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `item_soulbound_trade_data` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `lag_reports` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `lfg_data` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `log_arena_fights` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `log_arena_memberstats` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `log_encounter` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `log_money` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `mail` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `mail_items` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `mail_server_character` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `mail_server_template` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `petition` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `petition_sign` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pet_aura` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pet_spell` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pet_spell_cooldown` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pool_quest_save` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `profanity_name` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pvpstats_battlegrounds` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `pvpstats_players` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `quest_tracker` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `recovery_item` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `reserved_name` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `updates` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `updates_include` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `warden_action` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
ALTER TABLE `worldstates` ENGINE InnoDB ROW_FORMAT=DEFAULT, CONVERT TO CHARSET utf8mb4 COLLATE 'utf8mb4_unicode_ci';
