Updated migration query