Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-10-23 02:12:32 -0400
committerEike Stepper2018-10-23 02:12:32 -0400
commitd45944fb8048ae80c5c3c6ad2989bcdb544a1e5c (patch)
tree365b47f002d3532b73b7d1dece9282611f5e81ca
parentac1acd1c06a360c8db7d4c5217b7733e54e96905 (diff)
downloadcdo-d45944fb8048ae80c5c3c6ad2989bcdb544a1e5c.tar.gz
cdo-d45944fb8048ae80c5c3c6ad2989bcdb544a1e5c.tar.xz
cdo-d45944fb8048ae80c5c3c6ad2989bcdb544a1e5c.zip
[256856] Support model evolutioncommitters/estepper/evolution
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256856
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreMigrator.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server.evolution/src/org/eclipse/emf/cdo/server/spi/evolution/AbstractMigrationContext.java2
2 files changed, 20 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreMigrator.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreMigrator.java
index fba568afb4..9f6cce609b 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreMigrator.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreMigrator.java
@@ -43,6 +43,7 @@ import org.eclipse.net4j.db.IDBAdapter;
import org.eclipse.net4j.db.IDBConnection;
import org.eclipse.net4j.db.IDBSchemaTransaction;
import org.eclipse.net4j.db.ddl.IDBField;
+import org.eclipse.net4j.db.ddl.IDBNamedElement;
import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.db.ddl.delta.IDBSchemaDelta;
@@ -411,7 +412,7 @@ public class DBStoreMigrator
if (schemaTransaction != null)
{
IDBSchemaDelta schemaDelta = schemaTransaction.getSchemaDelta();
- context.log(DBUtil.dumpToString(schemaDelta));
+ log(schemaDelta);
schemaTransaction.commit();
}
@@ -425,9 +426,10 @@ public class DBStoreMigrator
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
- context.log("######################");
- context.log("Migrating instances...");
- context.log("######################");
+ if (oldRelease != null)
+ {
+ context.log("Migrating instances...");
+ }
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
@@ -466,7 +468,7 @@ public class DBStoreMigrator
}
IDBSchemaDelta schemaDelta = schemaTransaction.getSchemaDelta();
- context.log(DBUtil.dumpToString(schemaDelta));
+ log(schemaDelta);
schemaTransaction.commit();
}
@@ -647,6 +649,17 @@ public class DBStoreMigrator
}
}
+ private void log(IDBNamedElement element)
+ {
+ StringBuilder builder = new StringBuilder(DBUtil.dumpToString(element));
+ while (Character.isWhitespace(builder.charAt(builder.length() - 1)))
+ {
+ builder.setLength(builder.length() - 1);
+ }
+
+ context.log(builder);
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo.server.evolution/src/org/eclipse/emf/cdo/server/spi/evolution/AbstractMigrationContext.java b/plugins/org.eclipse.emf.cdo.server.evolution/src/org/eclipse/emf/cdo/server/spi/evolution/AbstractMigrationContext.java
index 12cec614d7..2e21350853 100644
--- a/plugins/org.eclipse.emf.cdo.server.evolution/src/org/eclipse/emf/cdo/server/spi/evolution/AbstractMigrationContext.java
+++ b/plugins/org.eclipse.emf.cdo.server.evolution/src/org/eclipse/emf/cdo/server/spi/evolution/AbstractMigrationContext.java
@@ -137,6 +137,7 @@ public abstract class AbstractMigrationContext implements MigrationContext
{
int toVersion = toRelease.getVersion();
String msg = repositoryName + (oldVersion == 0 ? "" : " from release v" + oldVersion) + " to release v" + toVersion;
+ log("===============================================");
log("Migrating " + msg);
evolutionSupport.migrateTo(toRelease, this, monitor.fork());
@@ -144,6 +145,7 @@ public abstract class AbstractMigrationContext implements MigrationContext
writeReleaseVersion(evolutionSupport, toVersion);
log("Migrated " + msg);
+ log("===============================================");
log("");
oldVersion = toVersion;

Back to the top