ALTER TABLE `aowow_spell`
    DROP INDEX `items`,
    DROP INDEX `effects`,
    ADD INDEX `idx_skill1` (`skillLine1`),
    ADD INDEX `idx_skill2` (`skillLine2OrMask`),
    ADD FULLTEXT `idx_name0` (`name_loc0`),
    ADD FULLTEXT `idx_name2` (`name_loc2`),
    ADD FULLTEXT `idx_name3` (`name_loc3`),
    ADD FULLTEXT `idx_name4` (`name_loc4`),
    ADD FULLTEXT `idx_name6` (`name_loc6`),
    ADD FULLTEXT `idx_name8` (`name_loc8`),
    ADD INDEX `idx_spellfamily` (`spellFamilyId`),
    ADD INDEX `idx_miscvalue1` (`effect1MiscValue`),
    ADD INDEX `idx_miscvalue2` (`effect2MiscValue`),
    ADD INDEX `idx_miscvalue3` (`effect3MiscValue`),
    ADD INDEX `idx_triggerspell1` (`effect1TriggerSpell`),
    ADD INDEX `idx_triggerspell2` (`effect2TriggerSpell`),
    ADD INDEX `idx_triggerspell3` (`effect3TriggerSpell`)
;

ALTER TABLE `aowow_quests`
    MODIFY COLUMN `name_loc0` varchar(100) DEFAULT NULL,
    MODIFY COLUMN `name_loc2` varchar(100) DEFAULT NULL,
    MODIFY COLUMN `name_loc3` varchar(100) DEFAULT NULL,
    MODIFY COLUMN `name_loc4` varchar(100) DEFAULT NULL,
    MODIFY COLUMN `name_loc6` varchar(100) DEFAULT NULL,
    MODIFY COLUMN `name_loc8` varchar(100) DEFAULT NULL,
    ADD FULLTEXT `idx_name0` (`name_loc0`),
    ADD FULLTEXT `idx_name2` (`name_loc2`),
    ADD FULLTEXT `idx_name3` (`name_loc3`),
    ADD FULLTEXT `idx_name4` (`name_loc4`),
    ADD FULLTEXT `idx_name6` (`name_loc6`),
    ADD FULLTEXT `idx_name8` (`name_loc8`),
    ADD INDEX `idx_sourcespell` (`sourceSpellId`),
    ADD INDEX `idx_rewardspell` (`rewardSpell`),
    ADD INDEX `idx_rewardcastspell` (`rewardSpellCast`),
    ADD INDEX `idx_classmask` (`reqRaceMask`),
    ADD INDEX `idx_racemask` (`reqClassMask`),
    ADD INDEX `idx_questsort` (`questSortId`),
    ADD INDEX `idx_rewarditem1` (`rewardChoiceItemId1`),
    ADD INDEX `idx_rewarditem2` (`rewardChoiceItemId2`),
    ADD INDEX `idx_rewarditem3` (`rewardChoiceItemId3`),
    ADD INDEX `idx_rewarditem4` (`rewardChoiceItemId4`),
    ADD INDEX `idx_rewarditem5` (`rewardChoiceItemId5`),
    ADD INDEX `idx_rewarditem6` (`rewardChoiceItemId6`),
    ADD INDEX `idx_rewardfaction1` (`rewardFactionId1`),
    ADD INDEX `idx_rewardfaction2` (`rewardFactionId2`),
    ADD INDEX `idx_rewardfaction3` (`rewardFactionId3`),
    ADD INDEX `idx_rewardfaction4` (`rewardFactionId4`),
    ADD INDEX `idx_rewardfaction5` (`rewardFactionId5`),
    ADD INDEX `idx_choiceitem1` (`rewardItemId1`),
    ADD INDEX `idx_choiceitem2` (`rewardItemId2`),
    ADD INDEX `idx_choiceitem3` (`rewardItemId3`),
    ADD INDEX `idx_choiceitem4` (`rewardItemId4`),
    ADD INDEX `idx_requirement1` (`reqNpcOrGo1`),
    ADD INDEX `idx_requirement2` (`reqNpcOrGo2`),
    ADD INDEX `idx_requirement3` (`reqNpcOrGo3`),
    ADD INDEX `idx_requirement4` (`reqNpcOrGo4`),
    ADD INDEX `idx_event` (`eventId`)
;

ALTER TABLE `aowow_creature`
    DROP INDEX `idx_name`,
    ADD INDEX `idx_trainer` (`trainerType`),
    ADD INDEX `idx_trainerrequirement` (`trainerRequirement`),
    ADD FULLTEXT `idx_name0` (`name_loc0`),
    ADD FULLTEXT `idx_name2` (`name_loc2`),
    ADD FULLTEXT `idx_name3` (`name_loc3`),
    ADD FULLTEXT `idx_name4` (`name_loc4`),
    ADD FULLTEXT `idx_name6` (`name_loc6`),
    ADD FULLTEXT `idx_name8` (`name_loc8`),
    ADD INDEX `idx_spell1` (`spell1`),
    ADD INDEX `idx_spell2` (`spell2`),
    ADD INDEX `idx_spell3` (`spell3`),
    ADD INDEX `idx_spell4` (`spell4`),
    ADD INDEX `idx_spell5` (`spell5`),
    ADD INDEX `idx_spell6` (`spell6`),
    ADD INDEX `idx_spell7` (`spell7`),
    ADD INDEX `idx_spell8` (`spell8`)
;

ALTER TABLE `aowow_items`
    DROP INDEX `spellId1`,
    DROP INDEX `spellId2`,
    DROP INDEX `idx_name`,
    ADD INDEX `idx_spell1` (`spellId1`),
    ADD INDEX `idx_spell2` (`spellId2`),
    ADD INDEX `idx_spell3` (`spellId3`),
    ADD INDEX `idx_spell4` (`spellId4`),
    ADD INDEX `idx_spell5` (`spellId5`),
    ADD INDEX `idx_trigger1` (`spellTrigger1`),
    ADD INDEX `idx_trigger2` (`spellTrigger2`),
    ADD INDEX `idx_trigger3` (`spellTrigger3`),
    ADD INDEX `idx_trigger4` (`spellTrigger4`),
    ADD INDEX `idx_trigger5` (`spellTrigger5`),
    ADD INDEX `idx_reqskill` (`requiredSkill`),
    ADD FULLTEXT `idx_name0` (`name_loc0`),
    ADD FULLTEXT `idx_name2` (`name_loc2`),
    ADD FULLTEXT `idx_name3` (`name_loc3`),
    ADD FULLTEXT `idx_name4` (`name_loc4`),
    ADD FULLTEXT `idx_name6` (`name_loc6`),
    ADD FULLTEXT `idx_name8` (`name_loc8`),
    ADD INDEX `idx_itemset` (`itemset`)
;

ALTER TABLE `aowow_objects`
    DROP INDEX `idx_name`,
    ADD INDEX `idx_onusespell` (`onUseSpell`),
    ADD INDEX `idx_onsuccessspell` (`onSuccessSpell`),
    ADD INDEX `idx_auraspell` (`auraSpell`),
    ADD INDEX `idx_triggeredspell` (`triggeredSpell`),
    ADD FULLTEXT `idx_name0` (`name_loc0`),
    ADD FULLTEXT `idx_name2` (`name_loc2`),
    ADD FULLTEXT `idx_name3` (`name_loc3`),
    ADD FULLTEXT `idx_name4` (`name_loc4`),
    ADD FULLTEXT `idx_name6` (`name_loc6`),
    ADD FULLTEXT `idx_name8` (`name_loc8`)
;

UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' achievementcriteria');
