Author: chatellier Date: 2011-03-31 13:48:34 +0000 (Thu, 31 Mar 2011) New Revision: 3221 Log: Add migration to remove unique maturitygroup constraints Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V331.java Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java isis-fish/branches/3.3.1/src/main/xmi/isis-fish.zargo Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java 2011-03-30 16:26:57 UTC (rev 3220) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java 2011-03-31 13:48:34 UTC (rev 3221) @@ -49,6 +49,7 @@ protected static final Version VERSION_32 = new Version("3.2"); protected static final Version VERSION_33 = new Version("3.3"); + protected static final Version VERSION_331 = new Version("3.3.1"); public DatabaseMigrationClass() { super(new MigrationResolver()); @@ -68,6 +69,9 @@ else if (version.equals(VERSION_33)) { result = MigrationV32V33.class; } + else if (version.equals(VERSION_331)) { + result = MigrationV33V331.class; + } return result; } @@ -78,7 +82,7 @@ */ @Override public Version[] getAvailableVersions() { - Version[] result = new Version[] { VERSION_32, VERSION_33 }; + Version[] result = new Version[] { VERSION_32, VERSION_33, VERSION_331 }; return result; } Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V331.java =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V331.java (rev 0) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V331.java 2011-03-31 13:48:34 UTC (rev 3221) @@ -0,0 +1,70 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Codelutin, Chatellier Eric + * %% + * 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 2 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-2.0.html>. + * #L% + */ + +package fr.ifremer.isisfish.datastore.migration; + +import java.util.List; + +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.migration.TopiaMigrationCallbackByClass; +import org.nuiton.topia.migration.TopiaMigrationCallbackByClass.MigrationCallBackForVersion; +import org.nuiton.util.Version; + +/** + * Migration between version 3.3 and 3.3.1 + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class MigrationV33V331 extends MigrationCallBackForVersion { + + /** + * Constructor. + * + * @param version version + * @param callback callback + */ + public MigrationV33V331(Version version, TopiaMigrationCallbackByClass callback) { + super(version, callback); + } + + /* + * @see org.nuiton.topia.migration.TopiaMigrationCallbackByClass.MigrationCallBackForVersion#prepareMigrationScript(org.nuiton.topia.framework.TopiaContextImplementor, java.util.List, boolean, boolean) + */ + @Override + protected void prepareMigrationScript(TopiaContextImplementor tx, + List<String> queries, boolean showSql, boolean showProgression) + throws TopiaException { + // remove maturity group + // CONSTRAINT_0 est la nom généré de la constainte d'unicité + // sur les maturityGroup + // en v3.3, il n'y a qu'une contrainte sur la table population + queries.add("ALTER TABLE POPULATION DROP CONSTRAINT CONSTRAINT_0;"); + } +} Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V331.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: isis-fish/branches/3.3.1/src/main/xmi/isis-fish.zargo =================================================================== (Binary files differ)