Correctly check if table exists in migration