Fix a crash when building creature_equip_template sql