Skip to content

Commit

Permalink
backporting NPE fix
Browse files Browse the repository at this point in the history
git-svn-id: http://liquibase.jira.com/svn/CORE/branches/1_9@1290 e6edf6fb-f266-4316-afb4-e53d95876a76
  • Loading branch information
nvoxland committed Feb 19, 2010
1 parent 3d62a88 commit 9427dbb
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -43,7 +43,7 @@ protected String convertFromDatabaseName (String objectName) {
}

/**
*
*
*/
protected void readUniqueConstraints (String schema) throws JDBCException, SQLException {
updateListeners("Reading unique constraints for " + database.toString() + " ...");
Expand All @@ -61,9 +61,15 @@ protected void readUniqueConstraints (String schema) throws JDBCException, SQLEx
String tableName = rs.getString("relname");
UniqueConstraint constraintInformation = new UniqueConstraint();
constraintInformation.setName(constraintName);
constraintInformation.setTable(tablesMap.get(tableName));
getColumnsForUniqueConstraint(conrelid, keys, constraintInformation);
foundUC.add(constraintInformation);
if (!database.isSystemTable(null, schema, tableName) && !database.isLiquibaseTable(tableName)) {
Table table = tablesMap.get(tableName);
if (table == null) {
throw new IllegalStateException("Cannot find table for " + tableName);
}
constraintInformation.setTable(table);
getColumnsForUniqueConstraint(conrelid, keys, constraintInformation);
foundUC.add(constraintInformation);
}
}
this.uniqueConstraints.addAll(foundUC);
}
Expand Down

0 comments on commit 9427dbb

Please sign in to comment.