Skip to content
Browse files

Mark backing index for primary key as handled as well.

In MissingTableChangeGenerator, auto increment primary keys are handled.
The backing index for the primary key should be handled as well.
Use AUTO_INCREMENT as the auto increment clause for H2.
The IDENTITY clause does not allow a constraint name to be specified when used for creating a table.
Removed redundant code from PostgreSQLIntegrationTest.
  • Loading branch information...
1 parent a2dc52c commit c6ffc101e422c37d245cacc36cc791fe99cf7f18 @damienbiggs damienbiggs committed Mar 26, 2013
View
4 liquibase-core/src/main/java/liquibase/database/core/H2Database.java
@@ -231,4 +231,8 @@ public boolean supportsInitiallyDeferrableColumns() {
return false;
}
+ @Override
+ protected String getAutoIncrementClause() {
+ return "AUTO_INCREMENT";
+ }
}
View
7 ...-core/src/main/java/liquibase/diff/output/changelog/core/MissingTableChangeGenerator.java
@@ -76,17 +76,12 @@ public int getPriority(Class<? extends DatabaseObject> objectType, Database data
constraintsConfig.setPrimaryKeyName(primaryKey.getName());
}
control.setAlreadyHandledMissing(primaryKey);
+ control.setAlreadyHandledMissing(primaryKey.getBackingIndex());
} else if (column.isNullable() != null && !column.isNullable()) {
constraintsConfig = new ConstraintsConfig();
constraintsConfig.setNullable(false);
}
-// if (column.isUnique()) {
-// if (constraintsConfig == null) {
-// constraintsConfig = new ConstraintsConfig();
-// }
-// constraintsConfig.setUnique(true);
-// }
if (constraintsConfig != null) {
columnConfig.setConstraints(constraintsConfig);
}
View
6 ...ase-integration-tests/src/test/java/liquibase/dbtest/pgsql/PostgreSQLIntegrationTest.java
@@ -8,10 +8,4 @@
public PostgreSQLIntegrationTest() throws Exception {
super("pgsql", "jdbc:postgresql://"+ getDatabaseServerHostname("PostgreSQL") +"/liquibase");
}
-
- @Override
- @Test
- public void testRunChangeLog() throws Exception {
- super.testRunChangeLog(); //To change body of overridden methods use File | Settings | File Templates.
- }
}

0 comments on commit c6ffc10

Please sign in to comment.
Something went wrong with that request. Please try again.