mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
DB2: Migration generation with Reorg table support (#54)
* prototype for reorg table * DB2 Migration fixes * Reorg handled by BaseTableDdl Co-authored-by: Roland Praml <roland.praml@foconis.de>
This commit is contained in:
1 parent
9f463437c2
commit
68f0c83603
16 files changed
+471
-75
No files matched your search
@@ -108,7 +108,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
|
||||
// Oracle caches the statement and does not detect schema change. It fails with
|
||||
// an ORA-01007
|
||||
if (isOracle()) {
|
||||
if (isOracle() || isDB2()) {
|
||||
result = server().sqlQuery("select * from migtest_e_basic order by id,id").findList();
|
||||
} else {
|
||||
result = server().sqlQuery("select * from migtest_e_basic order by id").findList();
|
||||
|
||||
@@ -51,6 +51,10 @@ public abstract class BaseTestCase {
|
||||
public boolean isSqlServer() {
|
||||
return Platform.SQLSERVER == platform();
|
||||
}
|
||||
|
||||
public boolean isDB2() {
|
||||
return Platform.DB2 == platform();
|
||||
}
|
||||
|
||||
public boolean isH2() {
|
||||
return Platform.H2 == platform();
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.ebean.annotation.DbMigration;
|
||||
import io.ebean.annotation.EnumValue;
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.NotNull;
|
||||
import io.ebean.annotation.Platform;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
@@ -59,10 +60,11 @@ public class EBasic {
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
|
||||
@DbMigration(preAlter = { "-- db2 does not support parial null indices :( - so we have to clean",
|
||||
"update ${table} set status = 'N' where id = 1" }, platforms = Platform.DB2)
|
||||
@DbMigration(preAlter = "-- rename all collisions")
|
||||
@Column(unique = true)
|
||||
@Size(max=127)
|
||||
@Size(max = 127)
|
||||
String description;
|
||||
|
||||
//@NotNull
|
||||
|
||||
Reference in new issue
Block a user