Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Mark backing index for primary key as handled as well. #125

Merged
merged 1 commit into from

2 participants

@damienbiggs

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.

@damienbiggs damienbiggs 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.
c6ffc10
@nvoxland nvoxland merged commit 8660de7 into liquibase:master
@nvoxland
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. @damienbiggs

    Mark backing index for primary key as handled as well.

    damienbiggs authored
    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.
This page is out of date. Refresh to see the latest.
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.
- }
}
Something went wrong with that request. Please try again.