Skip to content

Commit

Permalink
don't set the default value for an identity column on h2.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 1, 2012
1 parent f2f8c99 commit 509c9e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Expand Up @@ -67,6 +67,7 @@ protected Column readColumn(DatabaseMetaDataWrapper metaData, Map<String, Object
String autoIncrement = (String) values.get("IS_AUTOINCREMENT");
if (autoIncrement != null) {
column.setAutoIncrement("YES".equalsIgnoreCase(autoIncrement.trim()));
column.setDefaultValue(null);
}
return column;
}
Expand Down
Expand Up @@ -2,7 +2,10 @@

import java.io.InputStreamReader;

import junit.framework.Assert;

import org.jumpmind.db.io.DatabaseIO;
import org.jumpmind.db.model.Table;
import org.jumpmind.db.platform.IDatabasePlatform;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -21,5 +24,9 @@ public void testCreateDatabase() throws Exception {
platform.createDatabase(new DatabaseIO().read(new InputStreamReader(
DatabasePlatformTest.class.getResourceAsStream("/testCreateDatabase.xml"))), true,
false);

Table table = platform.getTableFromCache("test_simple_table", true);
Assert.assertNotNull(table);
Assert.assertEquals(true, table.getColumnWithName("id").isAutoIncrement());
}
}
@@ -1,4 +1,4 @@
test.root=mysql
test.root=h2
test.client=h2

mysql.db.driver=com.mysql.jdbc.Driver
Expand Down

0 comments on commit 509c9e7

Please sign in to comment.