Fixed enchantment index reversal while writing to database.