mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
DB migration initial
This commit is contained in:
@@ -21,7 +21,7 @@ public class BaseDdlHandlerTest extends BaseTestCase {
|
||||
|
||||
private BaseDdlHandler h2Handler() {
|
||||
DbTypeMap types = new H2Platform().getDbTypeMap();
|
||||
return new BaseDdlHandler(new DdlNamingConvention(), new H2Ddl(types));
|
||||
return new BaseDdlHandler(new DdlNamingConvention(), new H2Ddl(types, true));
|
||||
}
|
||||
|
||||
private BaseDdlHandler postgresHandler() {
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ public class BaseTableDdlTest {
|
||||
@Test
|
||||
public void testGenerate() throws Exception {
|
||||
|
||||
BaseTableDdl ddlGen = new BaseTableDdl(new DdlNamingConvention(), new H2Ddl(new DbTypeMap()));
|
||||
BaseTableDdl ddlGen = new BaseTableDdl(new DdlNamingConvention(), new H2Ddl(new DbTypeMap(), true));
|
||||
|
||||
DdlWrite write = new DdlWrite();
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ public class MigrationXmlWriterTest {
|
||||
@Test
|
||||
public void testWrite() throws Exception {
|
||||
|
||||
Migration migration = MigrationXmlReader.read("/test/container/test-create-table.xml");
|
||||
Migration migration = MigrationXmlReader.read("/container/test-create-table.xml");
|
||||
|
||||
File temp = File.createTempFile("migrationWrite",".xml");
|
||||
MigrationXmlWriter writer = new MigrationXmlWriter();
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ModelContainerApplyTest {
|
||||
@Test
|
||||
public void testApply() throws Exception {
|
||||
|
||||
Migration migration = MigrationXmlReader.read("/test/container/test-create-table.xml");
|
||||
Migration migration = MigrationXmlReader.read("/container/test-create-table.xml");
|
||||
|
||||
List<ChangeSet> changeSets = migration.getChangeSet();
|
||||
ChangeSet changeSet = changeSets.get(0);
|
||||
|
||||
+6
-1
@@ -25,9 +25,14 @@ public class ModelBuildBeanVisitorTest extends BaseTestCase {
|
||||
|
||||
new VisitAllUsing(addTable, defaultServer).visitAllBeans();
|
||||
|
||||
MTable item = model.getTable("item");
|
||||
|
||||
assertThat(item).isNotNull();
|
||||
assertThat(item.primaryKeyColumns()).hasSize(2);
|
||||
|
||||
MTable customer = model.getTable("o_customer");
|
||||
|
||||
assertThat(customer).isNotNull();
|
||||
|
||||
assertThat(customer.getSequenceName()).isNotNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user