Author: tchemit Date: 2012-09-22 16:56:11 +0200 (Sat, 22 Sep 2012) New Revision: 689 Url: http://forge.codelutin.com/repositories/revision/echobase/689 Log: refs #1521: Change Echotype relation type (no more *-*) (modification model + suppression ancienne migrations) Removed: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_2.java Modified: trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion trunk/echobase-domain/src/main/xmi/echobase-internal.properties trunk/echobase-domain/src/main/xmi/echobase.properties trunk/echobase-domain/src/main/xmi/echobase.zargo Deleted: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java 2012-09-22 14:52:13 UTC (rev 688) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_1.java 2012-09-22 14:56:11 UTC (rev 689) @@ -1,61 +0,0 @@ -package fr.ifremer.echobase.persistence.migration.workingDb; - -/* - * #%L - * EchoBase :: Domain - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -import org.nuiton.topia.TopiaException; -import org.nuiton.topia.framework.TopiaContextImplementor; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; - -import java.util.Arrays; -import java.util.List; - -/** - * Migration for version {@code 1.1}. - * - * @author tchemit <chemit@codelutin.com> - * @since 1.1 - */ -public class MigrationCallbackV1_1 extends MigrationCallBackForVersion { - - @Override - public Version getVersion() { - return VersionUtil.valueOf("1.1"); - } - - @Override - protected void prepareMigrationScript(TopiaContextImplementor tx, - List<String> queries, - boolean showSql, - boolean showProgression) throws TopiaException { - - String[] sqls = new String[]{ - "DROP TABLE echobaseuser;", - "DROP TABLE exportquery;" - }; - - queries.addAll(Arrays.asList(sqls)); - - } -} Deleted: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_2.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_2.java 2012-09-22 14:52:13 UTC (rev 688) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/MigrationCallbackV1_2.java 2012-09-22 14:56:11 UTC (rev 689) @@ -1,106 +0,0 @@ -package fr.ifremer.echobase.persistence.migration.workingDb; - -/* - * #%L - * EchoBase :: Domain - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.H2Dialect; -import org.hibernate.dialect.PostgreSQLDialect; -import org.nuiton.topia.TopiaException; -import org.nuiton.topia.TopiaNotFoundException; -import org.nuiton.topia.framework.TopiaContextImplementor; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; - -import java.util.List; - -/** - * Migration for version {@code 1.2}. - * - * @author tchemit <chemit@codelutin.com> - * @since 1.2 - */ -public class MigrationCallbackV1_2 extends MigrationCallBackForVersion { - - @Override - public Version getVersion() { - return VersionUtil.valueOf("1.2"); - } - - @Override - protected void prepareMigrationScript(TopiaContextImplementor tx, - List<String> queries, - boolean showSql, - boolean showProgression) throws TopiaException { - - // create new table import log (http://forge.codelutin.com/issues/1437) - createImportLogTable(tx, queries); - } - - protected void createImportLogTable(TopiaContextImplementor tx, - List<String> queries) throws TopiaNotFoundException { - Dialect dialect = - Dialect.getDialect(tx.getHibernateConfiguration().getProperties()); - - if (dialect instanceof PostgreSQLDialect) { - queries.add("CREATE TABLE importlog (\n" + - "topiaid character varying(255) NOT NULL,\n" + - "topiaversion bigint NOT NULL,\n" + - "topiacreatedate date,\n" + - "importdate date NOT NULL,\n" + - "importtext character varying(1024) NOT NULL,\n" + - "importuser character varying(255) NOT NULL,\n" + - "voyageid character varying(255) NOT NULL\n" + - ");"); - queries.add("ALTER TABLE importlog ADD CONSTRAINT PRIMARY_KEY_99A PRIMARY KEY(topiaid);"); - - queries.add("CREATE TABLE importlog_importid (\n" + - "owner character varying(255) NOT NULL,\n" + - "importid character varying(255) NOT NULL\n" + - ");"); - - queries.add("ALTER TABLE importlog_importid ADD CONSTRAINT FK2987B5F3CDA24477_INDEX_3 FOREIGN KEY(owner) REFERENCES importlog(topiaid);"); - - } else if (dialect instanceof H2Dialect) { - - queries.add("CREATE TABLE importlog (\n" + - "topiaid VARCHAR(255) NOT NULL,\n" + - "topiaversion BIGINT NOT NULL,\n" + - "topiacreatedate DATE NOT NULL ,\n" + - "importdate DATE NOT NULL ,\n" + - "importtext VARCHAR(1024) NOT NULL,\n" + - "importuser VARCHAR(255) NOT NULL,\n" + - "voyageid VARCHAR(255) NOT NULL\n" + - ");"); - - queries.add("ALTER TABLE importlog ADD CONSTRAINT PRIMARY_KEY_99A PRIMARY KEY(topiaid);"); - - queries.add("CREATE TABLE importlog_importid (\n" + - "owner VARCHAR(255) NOT NULL,\n" + - "importid VARCHAR(255)\n" + - ");"); - - queries.add("ALTER TABLE importlog_importid ADD CONSTRAINT FK2987B5F3CDA24477_INDEX_3 FOREIGN KEY(owner) REFERENCES importlog(topiaid);"); - } - } -} Modified: trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion =================================================================== --- trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion 2012-09-22 14:52:13 UTC (rev 688) +++ trunk/echobase-domain/src/main/resources/META-INF/services/fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallBackForVersion 2012-09-22 14:56:11 UTC (rev 689) @@ -1,2 +0,0 @@ -fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallbackV1_1 -fr.ifremer.echobase.persistence.migration.workingDb.MigrationCallbackV1_2 \ No newline at end of file Modified: trunk/echobase-domain/src/main/xmi/echobase-internal.properties =================================================================== --- trunk/echobase-domain/src/main/xmi/echobase-internal.properties 2012-09-22 14:52:13 UTC (rev 688) +++ trunk/echobase-domain/src/main/xmi/echobase-internal.properties 2012-09-22 14:56:11 UTC (rev 689) @@ -25,7 +25,7 @@ model.tagValue.generateOperatorForDAOHelper=true model.tagValue.generateStandaloneEnumForDAOHelper=true model.tagValue.constantPrefix=PROPERTY_ -model.tagValue.version=1.1 +model.tagValue.version=1.3 model.tagValue.noPCS=true model.tagValue.doNotGenerateBooleanGetMethods=true model.tagValue.indexForeignKeys=true Modified: trunk/echobase-domain/src/main/xmi/echobase.properties =================================================================== --- trunk/echobase-domain/src/main/xmi/echobase.properties 2012-09-22 14:52:13 UTC (rev 688) +++ trunk/echobase-domain/src/main/xmi/echobase.properties 2012-09-22 14:56:11 UTC (rev 689) @@ -25,7 +25,7 @@ model.tagValue.generateOperatorForDAOHelper=true model.tagValue.generateStandaloneEnumForDAOHelper=true model.tagValue.constantPrefix=PROPERTY_ -model.tagValue.version=1.2 +model.tagValue.version=1.3 model.tagValue.noPCS=true model.tagValue.doNotGenerateBooleanGetMethods=true model.tagValue.indexForeignKeys=true Modified: trunk/echobase-domain/src/main/xmi/echobase.zargo =================================================================== (Binary files differ)