r2735 - trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration
Author: nrannou Date: 2009-08-19 10:50:33 +0200 (Wed, 19 Aug 2009) New Revision: 2735 Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java Log: correction detection dialect Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java 2009-08-18 16:37:56 UTC (rev 2734) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java 2009-08-19 08:50:33 UTC (rev 2735) @@ -23,6 +23,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.dialect.Dialect; +import org.hibernate.dialect.H2Dialect; +import org.hibernate.dialect.PostgreSQLDialect; import org.nuiton.topia.migration.DatabaseManager; import org.nuiton.topia.migration.callback.MigrationCallbackHandler; import org.nuiton.util.VersionUtil; @@ -83,7 +85,7 @@ String[] sqls = null; // Script de migration - if ("org.hibernate.dialect.PostgreSQLDialect".equals(dialect)) { + if (dialect instanceof PostgreSQLDialect) { sqls = new String[] { "alter table useraccount rename langage to language;", "alter table pollaccount add accountid varchar;", @@ -93,7 +95,7 @@ "alter table vote add anonymous boolean default false;", "alter table preventrule add active boolean default true;", "alter table preventrule add onetime boolean default false;", }; - } else if ("org.hibernate.dialect.H2Dialect".equals(dialect)) { + } else if (dialect instanceof H2Dialect) { sqls = new String[] { "alter table useraccount alter column langage rename to language;", "alter table pollaccount add accountid varchar;",
participants (1)
-
nrannouļ¼ users.chorem.org