migrate queries