This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit b21ae5ad6370a43f87d49a36cfb7d2369a75a7a3 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jun 13 15:24:42 2015 +0200 ajout d'une migration pour supprimer la colonne gender (refs #7226) --- .../migration/AbstractDataSourceMigration.java | 6 +- .../DataSourceMigrationForVersion_4_0_1.java | 74 ++++++++++++++++++++++ .../resources/db/4.0.1/remove-gender-column-H2.sql | 1 + .../resources/db/4.0.1/remove-gender-column-PG.sql | 1 + 4 files changed, 81 insertions(+), 1 deletion(-) 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 388a070..4133d06 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 @@ -84,11 +84,15 @@ public abstract class AbstractDataSourceMigration extends TopiaMigrationCallback 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"); + /** 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_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 }; private static Supplier<ApplicationConfig> applicationConfigSupplier; diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_1.java b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_1.java new file mode 100644 index 0000000..1ac4f07 --- /dev/null +++ b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_1.java @@ -0,0 +1,74 @@ +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.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; + +import java.util.List; + +/** + * Created on 6/8/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 4.0.1 + */ +public class DataSourceMigrationForVersion_4_0_1 extends AbstractObserveMigrationCallBack { + + public DataSourceMigrationForVersion_4_0_1(AbstractDataSourceMigration callBack, String scriptSuffix) { + super(AbstractDataSourceMigration.V_4_0_1, callBack, scriptSuffix); + } + + @Override + protected void prepareMigrationScript(TopiaContextImplementor tx, + List<String> queries, + boolean showSql, + boolean showProgression) throws TopiaException { + + // See https://forge.codelutin.com/issues/7226 + addScript("remove-gender-column", queries); + + } + + public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_1 { + + public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, H2DataSourceMigration.TYPE); + } + + } + + public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_1 { + + public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, PGDataSourceMigration.TYPE); + } + + } + + +} diff --git a/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-H2.sql b/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-H2.sql new file mode 100644 index 0000000..a2296b1 --- /dev/null +++ b/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-H2.sql @@ -0,0 +1 @@ +ALTER TABLE observe_common.lengthweightparameter DROP COLUMN IF EXISTS gender; \ No newline at end of file diff --git a/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-PG.sql b/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-PG.sql new file mode 100644 index 0000000..a2296b1 --- /dev/null +++ b/observe-entities/src/main/resources/db/4.0.1/remove-gender-column-PG.sql @@ -0,0 +1 @@ +ALTER TABLE observe_common.lengthweightparameter DROP COLUMN IF EXISTS gender; \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.