Fix Postgres migration when schema is not public. (#6340)

This commit is contained in:
Adrienne Sox 2024-10-03 16:27:25 -04:00 committed by GitHub
parent 819ca04ba2
commit 40bdab00dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ public class DropPrimaryKeyTask extends BaseTableTask {
return null; // Irrelevant: We don't need to run the SQL for these databases.
case POSTGRES_9_4:
return "SELECT constraint_name " + "FROM information_schema.table_constraints "
+ "WHERE table_schema = 'public' "
+ "WHERE table_schema = coalesce(current_schema(), 'public') "
+ "AND constraint_type = 'PRIMARY KEY' "
+ "AND table_name = ?";
case ORACLE_12C: