branch feature/update_to_topia_3.7 created (now bb82eea1)
This is an automated email from the git hooks/post-receive script. New change to branch feature/update_to_topia_3.7 in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git at bb82eea1 Update to topia 3.7 This branch includes the following new commits: new bb82eea1 Update to topia 3.7 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit bb82eea140c03b2c0747d3ee0f0f11de23154481 Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Oct 9 18:09:42 2019 +0200 Update to topia 3.7 -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/update_to_topia_3.7 in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit bb82eea140c03b2c0747d3ee0f0f11de23154481 Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Oct 9 18:09:42 2019 +0200 Update to topia 3.7 --- .../migration/common/V3_1_0_5__Extract_email_addresses.java | 10 +++++++--- .../chorem/pollen/persistence/PollenFlywayServiceImpl.java | 13 ++++++++++--- pom.xml | 4 ++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java b/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java index 03666c69..402fd4d1 100644 --- a/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java +++ b/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java @@ -23,9 +23,10 @@ package db.migration.common; import org.apache.commons.lang3.StringUtils; import org.chorem.pollen.persistence.entity.PollenUserEmailAddress; -import org.flywaydb.core.api.migration.jdbc.JdbcMigration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.flywaydb.core.api.migration.BaseJavaMigration; +import org.flywaydb.core.api.migration.Context; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaIdFactory; import org.nuiton.topia.persistence.internal.ShortTopiaIdFactory; @@ -33,19 +34,22 @@ import org.nuiton.topia.persistence.internal.ShortTopiaIdFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Timestamp; import java.sql.Types; /** * @author Kevin Morin (Code Lutin) */ -public class V3_1_0_5__Extract_email_addresses implements JdbcMigration { +public class V3_1_0_5__Extract_email_addresses extends BaseJavaMigration { /** Logger. */ private static final Log log = LogFactory.getLog(V3_1_0_5__Extract_email_addresses.class); @Override - public void migrate(Connection connection) throws Exception { + public void migrate(Context context) throws SQLException { + + Connection connection = context.getConnection(); PreparedStatement insertStatement = null; PreparedStatement updateStatement = null; diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/persistence/PollenFlywayServiceImpl.java b/pollen-persistence/src/main/java/org/chorem/pollen/persistence/PollenFlywayServiceImpl.java index 9716f43a..9db2899c 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/persistence/PollenFlywayServiceImpl.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/persistence/PollenFlywayServiceImpl.java @@ -22,7 +22,7 @@ package org.chorem.pollen.persistence; */ import com.google.common.collect.Lists; -import org.flywaydb.core.Flyway; +import org.flywaydb.core.api.configuration.ClassicConfiguration; import org.nuiton.topia.flyway.TopiaFlywayServiceImpl; import org.nuiton.topia.persistence.TopiaApplicationContext; @@ -34,7 +34,7 @@ import java.util.List; public class PollenFlywayServiceImpl extends TopiaFlywayServiceImpl { @Override - protected void setLocations(Flyway flyway, TopiaApplicationContext topiaApplicationContext) { + protected void setLocations(ClassicConfiguration flywayConfiguration, TopiaApplicationContext topiaApplicationContext) { List<String> locations = Lists.newArrayList("db/migration/common"); String jdbcUrl = topiaApplicationContext.getConfiguration().getJdbcConnectionUrl(); @@ -45,6 +45,13 @@ public class PollenFlywayServiceImpl extends TopiaFlywayServiceImpl { } String[] locationsArray = locations.toArray(new String[locations.size()]); - flyway.setLocations(locationsArray); + flywayConfiguration.setLocationsAsStrings(locationsArray); + } + + @Override + protected void doExtraConfiguration(ClassicConfiguration flywayConfiguration, TopiaApplicationContext topiaApplicationContext) { + // Since flyway 6, default table name have changed so for backward compatibility with old pollen instance + // we fallback to the old table name to store migration state + flywayConfiguration.setTable("schema_version"); } } diff --git a/pom.xml b/pom.xml index 32367397..c226a13d 100644 --- a/pom.xml +++ b/pom.xml @@ -179,8 +179,8 @@ <nuitonI18nVersion>3.7</nuitonI18nVersion> <eugenePluginVersion>3.0-alpha-10</eugenePluginVersion> - <topiaVersion>3.6</topiaVersion> - <flywayVersion>5.0.0</flywayVersion> + <topiaVersion>3.7</topiaVersion> + <flywayVersion>6.0.4</flywayVersion> <nuitonWebVersion>1.20</nuitonWebVersion> <nuitonUtilsVersion>3.0</nuitonUtilsVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm