mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 14:46:25 +00:00
Noemis Änderungen übernommen
This commit is contained in:
1 parent
c1cdfb41f6
commit
3442dd9547
6 files changed
+36
-18
No files matched your search
@@ -50,6 +50,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
"migtest_fk_set_null",
|
||||
"migtest_mtm_c",
|
||||
"migtest_mtm_m",
|
||||
"migtest_mtm_m_phone_numbers",
|
||||
"migtest_mtm_c_migtest_mtm_m",
|
||||
"migtest_mtm_m_migtest_mtm_c",
|
||||
"migtest_oto_child",
|
||||
@@ -184,7 +185,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
sb.append("drop view ").append(table).append("_with_history;\n");
|
||||
sb.append("drop sequence ").append(table).append("_seq;\n");
|
||||
}
|
||||
|
||||
System.err.println(sb);
|
||||
runScript(true, sb.toString(), "cleanup");
|
||||
runScript(true, sb.toString(), "cleanup");
|
||||
}
|
||||
|
||||
+1
@@ -37,6 +37,7 @@ public class MysqlGenerateMigrationTest {
|
||||
config.getProperties().put("ebean.migrationtest.migration.pathToResources", pathToResources);
|
||||
config.getProperties().put("ebean.migrationtest.migration.platforms", "mysql");
|
||||
config.getProperties().put("ebean.migrationtest.migration.migrationPath", "dbmigration/migrationtest-procedures/");
|
||||
config.getProperties().put("ebean.migrationtest.migration.migrationInitPath", "dbinit/migrationtest-procedures/");
|
||||
config.setPackages(Arrays.asList("misc.migration.mysql_v1_0"));
|
||||
|
||||
// First, we clean up the output-directory
|
||||
|
||||
+14
@@ -2,6 +2,7 @@ package io.ebeaninternal.dbmigration.ddlgeneration.platform;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.dbplatform.db2.DB2LuwPlatform;
|
||||
import io.ebean.config.dbplatform.h2.H2Platform;
|
||||
import io.ebean.config.dbplatform.hana.HanaPlatform;
|
||||
import io.ebean.config.dbplatform.mysql.MySqlPlatform;
|
||||
@@ -23,6 +24,7 @@ public class PlatformDdl_CreateIndexTest {
|
||||
private final PlatformDdl oraDdl = PlatformDdlBuilder.create(new OraclePlatform());
|
||||
private final PlatformDdl sqlServerDdl = PlatformDdlBuilder.create(new SqlServer17Platform());
|
||||
private final PlatformDdl hanaDdl = PlatformDdlBuilder.create(new HanaPlatform());
|
||||
private final PlatformDdl db2LuwDdl = PlatformDdlBuilder.create(new DB2LuwPlatform());
|
||||
|
||||
{
|
||||
DatabaseConfig config = DB.getDefault().pluginApi().config();
|
||||
@@ -32,6 +34,7 @@ public class PlatformDdl_CreateIndexTest {
|
||||
oraDdl.configure(config);
|
||||
sqlServerDdl.configure(config);
|
||||
hanaDdl.configure(config);
|
||||
db2LuwDdl.configure(config);
|
||||
}
|
||||
|
||||
WriteCreateIndex writeCreateIndex() {
|
||||
@@ -71,6 +74,8 @@ public class PlatformDdl_CreateIndexTest {
|
||||
assertEquals("create unique index ix_mytab_acol on mytab (acol)", sql);
|
||||
sql = hanaDdl.createIndex(createIndex);
|
||||
assertThat(sql).isEqualTo("-- explicit index \"ix_mytab_acol\" for single column \"acol\" of table \"mytab\" is not necessary");
|
||||
sql = db2LuwDdl.createIndex(createIndex);
|
||||
assertThat(sql).isEqualTo("create unique index ix_mytab_acol on mytab (acol)");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -95,4 +100,13 @@ public class PlatformDdl_CreateIndexTest {
|
||||
assertEquals("create index ix_mytab_acol on mytab (acol)", sql);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void db2luw_fkeyCreateIndex() {
|
||||
String sql = db2LuwDdl.createIndex(fkeyCreateIndex(true));
|
||||
assertEquals("create unique index ix_mytab_acol on mytab (acol)", sql);
|
||||
|
||||
sql = db2LuwDdl.createIndex(fkeyCreateIndex(false));
|
||||
assertEquals("create index ix_mytab_acol on mytab (acol)", sql);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package misc.migration.v1_1;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.ElementCollection;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
@@ -19,6 +20,9 @@ public class MtmMaster {
|
||||
@ManyToMany
|
||||
List<MtmChild> children;
|
||||
|
||||
@ElementCollection
|
||||
List<String> phoneNumbers;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ datasource.default=h2
|
||||
|
||||
datasource.h2.username=sa
|
||||
datasource.h2.password=
|
||||
datasource.h2.url=jdbc:h2:mem:h2AutoTune
|
||||
datasource.h2.url=jdbc:h2:mem:h2AutoTune;NON_KEYWORDS=KEY,VALUE
|
||||
|
||||
datasource.db2.username=migtest
|
||||
datasource.db2.password=migtest
|
||||
@@ -18,7 +18,7 @@ datasource.pg.url=jdbc:h2:mem:h2AutoTune
|
||||
# parameters for migration test
|
||||
datasource.migrationtest.username=SA
|
||||
datasource.migrationtest.password=SA
|
||||
datasource.migrationtest.url=jdbc:h2:mem:migration
|
||||
datasource.migrationtest.url=jdbc:h2:mem:migration;NON_KEYWORDS=KEY,VALUE
|
||||
ebean.migrationtest.applyPrefix=V
|
||||
ebean.migrationtest.ddl.generate=false
|
||||
ebean.migrationtest.ddl.run=false
|
||||
@@ -31,7 +31,7 @@ ebean.migrationtest.migration.run=true
|
||||
ebean.migrationtest.migration.includeIndex=true
|
||||
ebean.migrationtest.migration.generateInit=true
|
||||
ebean.migrationtest.migration.generatePendingDrop=auto
|
||||
ebean.migrationtest.migration.platforms=db2,h2,hsqldb,mysql,mysql55=mysql55,postgres,oracle,sqlite,sqlserver17=sqlserver17,hana
|
||||
ebean.migrationtest.migration.platforms=db2luw=db2,h2,hsqldb,mysql,mysql55=mysql55,postgres,oracle,sqlite,sqlserver17=sqlserver17,hana
|
||||
|
||||
# need to generate unique statements to prevent them from being filtered out as duplicates by the DdlRunner
|
||||
ebean.hana.generateUniqueDdl=true
|
||||
|
||||
Reference in new issue
Block a user