Prepare the queries after the database was migrated.