This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 8a3ba1e254d2fa32e846f7cab6d24c2e766bd8cf Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 9 18:12:22 2016 +0100 Ajout migration manquante (See #7542) --- .../migration/AbstractDataSourceMigration.java | 38 ++++-------- .../DataSourceMigrationForVersion_4_0_4.java | 70 ++++++++++++++++++++++ ...0_4_01_remove-trip-datearriveeport-field-H2.sql | 23 +++++++ ...0_4_01_remove-trip-datearriveeport-field-PG.sql | 23 +++++++ 4 files changed, 128 insertions(+), 26 deletions(-) diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java b/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java index ca7a548..63e3d12 100644 --- a/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java +++ b/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java @@ -39,66 +39,52 @@ import java.util.List; */ public abstract class AbstractDataSourceMigration extends TopiaMigrationCallbackByClass { - /** Logger */ + /** + * Logger + */ static private Log log = LogFactory.getLog(AbstractDataSourceMigration.class); public static final Version V_3_0 = Versions.valueOf("3.0"); - public static final Version V_3_1 = Versions.valueOf("3.1"); - public static final Version V_3_5 = Versions.valueOf("3.5"); - public static final Version V_3_7 = Versions.valueOf("3.7"); - public static final Version V_3_8 = Versions.valueOf("3.8"); - public static final Version V_3_9 = Versions.valueOf("3.9"); - public static final Version V_3_10 = Versions.valueOf("3.10"); - public static final Version V_3_11 = Versions.valueOf("3.11"); - public static final Version V_3_12 = Versions.valueOf("3.12"); - public static final Version V_3_14 = Versions.valueOf("3.14"); - public static final Version V_3_15 = Versions.valueOf("3.15"); - public static final Version V_3_16 = Versions.valueOf("3.16"); public static final Version V_4_0_RC2 = Versions.valueOf("4.0-RC2"); - public static final Version V_4_0_RC3 = Versions.valueOf("4.0-RC3"); - public static final Version V_4_0_RC4 = Versions.valueOf("4.0-RC4"); - public static final Version V_4_0_RC6 = Versions.valueOf("4.0-RC6"); - public static final Version V_4_0_RC7 = Versions.valueOf("4.0-RC7"); public static final Version V_4_0 = Versions.valueOf("4.0"); - public static final Version V_4_0_1 = Versions.valueOf("4.0.1"); - public static final Version V_4_0_2 = Versions.valueOf("4.0.2"); - - // FIXME A utiliser en version final 5.0 - public static final Version V_5_0 = Versions.valueOf("5.0"); + public static final Version V_4_0_4 = Versions.valueOf("4.0.4"); public static final Version V_4_900 = Versions.valueOf("4.900"); - public static final Version V_4_901 = Versions.valueOf("4.901"); - public static final Version V_4_902 = Versions.valueOf("4.902"); - /** Les versions de mise à jour disponibles. */ + // FIXME A utiliser en version final 5.0 + public static final Version V_5_0 = Versions.valueOf("5.0"); + + /** + * Les versions de mise à jour disponibles. + */ public static final Version[] availableVersions = new Version[]{ V_3_1, V_3_5, V_3_7, V_3_8, V_3_9, V_3_10, V_3_11, V_3_12, V_3_14, V_3_15, V_3_16, V_4_0_RC2, - V_4_0_RC3, V_4_0_RC4, V_4_0_RC6, V_4_0_RC7, V_4_0, V_4_0_1, V_4_0_2, + V_4_0_RC3, V_4_0_RC4, V_4_0_RC6, V_4_0_RC7, V_4_0, V_4_0_1, V_4_0_2, V_4_0_4, + V_4_900, V_4_901, V_4_902 // FIXME A utiliser en version final 5.0 //V_5_0 - V_4_900, V_4_901, V_4_902 }; diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java new file mode 100644 index 0000000..df23d87 --- /dev/null +++ b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java @@ -0,0 +1,70 @@ +package fr.ird.observe.entities.migration.versions; + +/* + * #%L + * ObServe :: Entities + * %% + * Copyright (C) 2008 - 2015 IRD, Codelutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.entities.migration.AbstractDataSourceMigration; +import fr.ird.observe.entities.migration.AbstractObserveMigrationCallBack; +import fr.ird.observe.entities.migration.H2DataSourceMigration; +import fr.ird.observe.entities.migration.PGDataSourceMigration; +import org.nuiton.topia.persistence.TopiaException; +import org.nuiton.topia.persistence.support.TopiaSqlSupport; + +import java.util.List; + +/** + * Created on 6/8/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 4.0.1 + */ +public abstract class DataSourceMigrationForVersion_4_0_4 extends AbstractObserveMigrationCallBack { + + public DataSourceMigrationForVersion_4_0_4(AbstractDataSourceMigration callBack, String scriptSuffix) { + super(AbstractDataSourceMigration.V_4_0_4, callBack, scriptSuffix); + } + + @Override + protected void prepareMigrationScript(TopiaSqlSupport sqlSupport, List<String> queries, boolean showSql, boolean showProgression) throws TopiaException { + + // supprimer un champs résiduel (Voir http://forge.codelutin.com/issues/7542) + addScript("01", "remove-trip-datearriveeport-field", queries); + + } + + public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_4 { + + public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, H2DataSourceMigration.TYPE); + } + + } + + public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_4 { + + public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, PGDataSourceMigration.TYPE); + } + + } + +} diff --git a/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-H2.sql b/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-H2.sql new file mode 100644 index 0000000..d8b239e --- /dev/null +++ b/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-H2.sql @@ -0,0 +1,23 @@ +--- +-- #%L +-- ObServe :: Entities +-- %% +-- Copyright (C) 2008 - 2015 IRD, Codelutin, Tony Chemit +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/gpl-3.0.html>. +-- #L% +--- + +ALTER TABLE observe_seine.trip DROP COLUMN datearriveeport; \ No newline at end of file diff --git a/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-PG.sql b/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-PG.sql new file mode 100644 index 0000000..d8b239e --- /dev/null +++ b/observe-entities/src/main/resources/db/migration/V4_0_4_01_remove-trip-datearriveeport-field-PG.sql @@ -0,0 +1,23 @@ +--- +-- #%L +-- ObServe :: Entities +-- %% +-- Copyright (C) 2008 - 2015 IRD, Codelutin, Tony Chemit +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/gpl-3.0.html>. +-- #L% +--- + +ALTER TABLE observe_seine.trip DROP COLUMN datearriveeport; \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.