Tony CHEMIT pushed to branch feature/873 at ultreiaio / ird-observe
Commits:
-
cc459a56
by Tony CHEMIT at 2017-09-14T12:22:40Z
16 changed files:
- client/src/main/assembly/dist/obstuna-admin/extra/create-postgis-4-activity-longine.sql
- persistence/src/main/java/fr/ird/observe/entities/longline/ActivityLonglineObsTopiaDao.java
- persistence/src/main/java/fr/ird/observe/entities/longline/TripLonglineTopiaDao.java
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaApplicationContext.java
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_9.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/H2DataSourceMigration.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/PGDataSourceMigration.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/6.904/01_rename_longline_obs-H2.sql
- pom.xml
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- + test/src/main/resources/db/6.904/dataForTestLongline.sql.gz
- + test/src/main/resources/db/6.904/dataForTestSeine.sql.gz
- + test/src/main/resources/db/6.904/empty_h2.sql.gz
- + test/src/main/resources/db/6.904/empty_pg.sql.gz
- + test/src/main/resources/db/6.904/referentiel.sql.gz
Changes:
| ... | ... | @@ -21,6 +21,6 @@ |
| 21 | 21 |
---
|
| 22 | 22 |
|
| 23 | 23 |
SELECT AddGeometryColumn('observe_longline','activity', 'the_geom', 4326, 'POINT',2 );
|
| 24 |
-UPDATE observe_longline.activity SET the_geom=ST_SetSRID(ST_MakePoint(longitude,latitude), 4326);
|
|
| 25 |
-DROP TRIGGER IF EXISTS tr_sync_longline_activity_the_geom ON observe_longline.activity;
|
|
| 26 |
-CREATE TRIGGER tr_sync_longline_activity_the_geom BEFORE insert or update ON observe_longline.activity FOR EACH ROW EXECUTE PROCEDURE sync_activity_the_geom();
|
|
| 24 |
+UPDATE observe_longline.activityobs SET the_geom=ST_SetSRID(ST_MakePoint(longitude,latitude), 4326);
|
|
| 25 |
+DROP TRIGGER IF EXISTS tr_sync_longline_activity_the_geom ON observe_longline.activityobs;
|
|
| 26 |
+CREATE TRIGGER tr_sync_longline_activity_the_geom BEFORE insert or update ON observe_longline.activityobs FOR EACH ROW EXECUTE PROCEDURE sync_activity_the_geom();
|
| ... | ... | @@ -54,10 +54,10 @@ public class ActivityLonglineObsTopiaDao extends AbstractActivityLonglineObsTopi |
| 54 | 54 |
String sql = "SELECT" +
|
| 55 | 55 |
" a.topiaId," +
|
| 56 | 56 |
" a.timestamp," +
|
| 57 |
- " a.set," +
|
|
| 57 |
+ " a.setObs," +
|
|
| 58 | 58 |
" va.topiaId," +
|
| 59 | 59 |
" va." + I18nReferenceEntities.getPropertyName(referenceLocale) +
|
| 60 |
- " FROM observe_longline.activity a, observe_longline.vesselactivity va" +
|
|
| 60 |
+ " FROM observe_longline.activityobs a, observe_longline.vesselactivity va" +
|
|
| 61 | 61 |
" WHERE " +
|
| 62 | 62 |
" a.trip = ?" +
|
| 63 | 63 |
" AND a.vesselactivity = va.topiaid" +
|
| ... | ... | @@ -73,10 +73,10 @@ public class ActivityLonglineObsTopiaDao extends AbstractActivityLonglineObsTopi |
| 73 | 73 |
String sql = "SELECT" +
|
| 74 | 74 |
" a.topiaId," +
|
| 75 | 75 |
" a.timestamp," +
|
| 76 |
- " a.set," +
|
|
| 76 |
+ " a.setObs," +
|
|
| 77 | 77 |
" va.topiaId," +
|
| 78 | 78 |
" va." + I18nReferenceEntities.getPropertyName(referenceLocale) +
|
| 79 |
- " FROM observe_longline.activity a, observe_longline.vesselactivity va" +
|
|
| 79 |
+ " FROM observe_longline.activityobs a, observe_longline.vesselactivity va" +
|
|
| 80 | 80 |
" WHERE " +
|
| 81 | 81 |
" a.topiaId = ?" +
|
| 82 | 82 |
" AND a.vesselactivity = va.topiaid" +
|
| ... | ... | @@ -121,9 +121,9 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 121 | 121 |
" s.haulingEndTimestamp," +
|
| 122 | 122 |
" s.haulingEndLatitude," +
|
| 123 | 123 |
" s.haulingEndLongitude" +
|
| 124 |
- " FROM observe_longLine.activity a" +
|
|
| 125 |
- " LEFT OUTER JOIN observe_longLine.set s" +
|
|
| 126 |
- " ON s.topiaId = a.set" +
|
|
| 124 |
+ " FROM observe_longLine.activityobs a" +
|
|
| 125 |
+ " LEFT OUTER JOIN observe_longLine.setobs s" +
|
|
| 126 |
+ " ON s.topiaId = a.setObs" +
|
|
| 127 | 127 |
" WHERE a.trip = ?" +
|
| 128 | 128 |
" ORDER BY a.timestamp";
|
| 129 | 129 |
|
| ... | ... | @@ -271,7 +271,7 @@ public class TripLonglineTopiaDao extends AbstractTripLonglineTopiaDao<TripLongl |
| 271 | 271 |
public static Timestamp find(TopiaSqlSupport context, String tripId) {
|
| 272 | 272 |
|
| 273 | 273 |
String sql = "SELECT max(a.timestamp)" +
|
| 274 |
- " FROM observe_longline.activity a" +
|
|
| 274 |
+ " FROM observe_longline.activityobs a" +
|
|
| 275 | 275 |
" WHERE a.trip = ?";
|
| 276 | 276 |
|
| 277 | 277 |
TheoricalEndOfDateSqlQuery request = new TheoricalEndOfDateSqlQuery(sql, tripId);
|
| ... | ... | @@ -323,8 +323,8 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 323 | 323 |
basketTable.getTableName(),
|
| 324 | 324 |
basketTable.getFromClause(),
|
| 325 | 325 |
basketTable.getWhereClauseAlias(),
|
| 326 |
- ImmutableSet.of(" INNER JOIN observe_longline.set set ON set.topiaId = activity.set",
|
|
| 327 |
- " INNER JOIN observe_longline.basket basket ON basket.set = set.topiaId"
|
|
| 326 |
+ ImmutableSet.of(" INNER JOIN observe_longline.setObs setObs ON setObs.topiaId = activityObs.setObs",
|
|
| 327 |
+ " INNER JOIN observe_longline.basket basket ON basket.setObs= setObs.topiaId"
|
|
| 328 | 328 |
),
|
| 329 | 329 |
null);
|
| 330 | 330 |
|
| ... | ... | @@ -339,8 +339,8 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat |
| 339 | 339 |
branchlineTable.getTableName(),
|
| 340 | 340 |
branchlineTable.getFromClause(),
|
| 341 | 341 |
branchlineTable.getWhereClauseAlias(),
|
| 342 |
- ImmutableSet.of(" INNER JOIN observe_longline.set set ON set.topiaId = activity.set",
|
|
| 343 |
- " INNER JOIN observe_longline.basket basket ON basket.set = set.topiaId",
|
|
| 342 |
+ ImmutableSet.of(" INNER JOIN observe_longline.setObs setObs ON setObs.topiaId = activityObs.setObs",
|
|
| 343 |
+ " INNER JOIN observe_longline.basket basket ON basket.setObs = setObs.topiaId",
|
|
| 344 | 344 |
" INNER JOIN observe_longline.branchline branchline ON branchline.basket = basket.topiaId"
|
| 345 | 345 |
),
|
| 346 | 346 |
null);
|
| 1 |
+package fr.ird.observe.persistence.migration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Persistence
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2017 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import java.util.List;
|
|
| 26 |
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
|
|
| 27 |
+ |
|
| 28 |
+/**
|
|
| 29 |
+ * Created by tchemit on 13/09/17.
|
|
| 30 |
+ *
|
|
| 31 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 32 |
+ */
|
|
| 33 |
+@MigrationVersion(version = "6.904")
|
|
| 34 |
+public abstract class DataSourceMigrationForVersion_7_0_RC_9 extends AbstractObserveMigrationCallBack {
|
|
| 35 |
+ |
|
| 36 |
+ DataSourceMigrationForVersion_7_0_RC_9(AbstractDataSourceMigration callBack, String scriptSuffix) {
|
|
| 37 |
+ super(DataSourceMigrationForVersion_7_0_RC_9.class, callBack, scriptSuffix);
|
|
| 38 |
+ }
|
|
| 39 |
+ |
|
| 40 |
+ protected abstract void removeForeignKeys(TopiaSqlSupport topiaSqlSupport, List<String> queries);
|
|
| 41 |
+ |
|
| 42 |
+ @Override
|
|
| 43 |
+ protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
|
|
| 44 |
+ |
|
| 45 |
+ removeForeignKeys(topiaSqlSupport, queries);
|
|
| 46 |
+ |
|
| 47 |
+ addScript("01", "rename_longline_obs", queries);
|
|
| 48 |
+ |
|
| 49 |
+ }
|
|
| 50 |
+ |
|
| 51 |
+ public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_9 {
|
|
| 52 |
+ |
|
| 53 |
+ public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
|
|
| 54 |
+ super(callBack, H2DataSourceMigration.TYPE);
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+ @Override
|
|
| 58 |
+ protected void removeForeignKeys(TopiaSqlSupport topiaSqlSupport, List<String> queries) {
|
|
| 59 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Encounter", "activity", queries);
|
|
| 60 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "SensorUsed", "activity", queries);
|
|
| 61 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Activity", "set", queries);
|
|
| 62 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "BaitsComposition", "set", queries);
|
|
| 63 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Basket", "set", queries);
|
|
| 64 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "BranchlinesComposition", "set", queries);
|
|
| 65 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Catch", "set", queries);
|
|
| 66 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "FloatlinesComposition", "set", queries);
|
|
| 67 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "HooksComposition", "set", queries);
|
|
| 68 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Mitigationtype_set", "set", queries);
|
|
| 69 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Section", "set", queries);
|
|
| 70 |
+ H2DataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Tdr", "set", queries);
|
|
| 71 |
+ }
|
|
| 72 |
+ }
|
|
| 73 |
+ |
|
| 74 |
+ public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_9 {
|
|
| 75 |
+ |
|
| 76 |
+ public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
|
|
| 77 |
+ super(callBack, PGDataSourceMigration.TYPE);
|
|
| 78 |
+ }
|
|
| 79 |
+ |
|
| 80 |
+ @Override
|
|
| 81 |
+ protected void removeForeignKeys(TopiaSqlSupport topiaSqlSupport, List<String> queries) {
|
|
| 82 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "encounter", "activity", queries);
|
|
| 83 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "sensorUsed", "activity", queries);
|
|
| 84 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Activity", "set", queries);
|
|
| 85 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "BaitsComposition", "set", queries);
|
|
| 86 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Basket", "set", queries);
|
|
| 87 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "BranchlinesComposition", "set", queries);
|
|
| 88 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Catch", "set", queries);
|
|
| 89 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "FloatlinesComposition", "set", queries);
|
|
| 90 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "HooksComposition", "set", queries);
|
|
| 91 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Mitigationtype_set", "set", queries);
|
|
| 92 |
+ PGDataSourceMigration.removeFK(topiaSqlSupport, "observe_longline", "Tdr", "set", queries);
|
|
| 93 |
+ }
|
|
| 94 |
+ }
|
|
| 95 |
+ |
|
| 96 |
+}
|
|
| 97 |
+ |
|
| 98 |
+ |
| ... | ... | @@ -233,22 +233,22 @@ public class H2DataSourceMigration extends AbstractDataSourceMigration { |
| 233 | 233 |
public static void removeFK(TopiaSqlSupport tx, String schemaName, String tableName, String columnName, List<String> queries) {
|
| 234 | 234 |
|
| 235 | 235 |
// Get fk constraints
|
| 236 |
- String contrainstName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, true);
|
|
| 236 |
+ String constraintsName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, true);
|
|
| 237 | 237 |
|
| 238 | 238 |
// remove constraints
|
| 239 |
- queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, contrainstName));
|
|
| 239 |
+ queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, constraintsName));
|
|
| 240 | 240 |
|
| 241 | 241 |
}
|
| 242 | 242 |
|
| 243 | 243 |
public static void removeFKIfExists(TopiaSqlSupport tx, String schemaName, String tableName, String columnName, List<String> queries) {
|
| 244 | 244 |
|
| 245 | 245 |
// Get fk constraints
|
| 246 |
- String contrainstName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, false);
|
|
| 246 |
+ String constraintsName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, false);
|
|
| 247 | 247 |
|
| 248 |
- if (contrainstName != null) {
|
|
| 248 |
+ if (constraintsName != null) {
|
|
| 249 | 249 |
|
| 250 | 250 |
// remove constraints
|
| 251 |
- queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, contrainstName));
|
|
| 251 |
+ queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, constraintsName));
|
|
| 252 | 252 |
|
| 253 | 253 |
}
|
| 254 | 254 |
|
| ... | ... | @@ -317,22 +317,22 @@ public class PGDataSourceMigration extends AbstractDataSourceMigration { |
| 317 | 317 |
public static void removeFK(TopiaSqlSupport tx, String schemaName, String tableName, String columnName, List<String> queries) {
|
| 318 | 318 |
|
| 319 | 319 |
// Get fk constraints
|
| 320 |
- String contrainstName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, true);
|
|
| 320 |
+ String constraintsName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, true);
|
|
| 321 | 321 |
|
| 322 | 322 |
// remove constraints
|
| 323 |
- queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, contrainstName));
|
|
| 323 |
+ queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, constraintsName));
|
|
| 324 | 324 |
|
| 325 | 325 |
}
|
| 326 | 326 |
|
| 327 | 327 |
public static void removeFKIfExists(TopiaSqlSupport tx, String schemaName, String tableName, String columnName, List<String> queries) {
|
| 328 | 328 |
|
| 329 | 329 |
// Get fk constraints
|
| 330 |
- String contrainstName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, false);
|
|
| 330 |
+ String constraintsName = getForeignKeyConstraintName(tx, schemaName, tableName, columnName, false);
|
|
| 331 | 331 |
|
| 332 |
- if (contrainstName != null) {
|
|
| 332 |
+ if (constraintsName != null) {
|
|
| 333 | 333 |
|
| 334 | 334 |
// remove constraints
|
| 335 |
- queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, contrainstName));
|
|
| 335 |
+ queries.add(String.format("ALTER TABLE %s.%s DROP CONSTRAINT %s;", schemaName, tableName, constraintsName));
|
|
| 336 | 336 |
|
| 337 | 337 |
}
|
| 338 | 338 |
|
| ... | ... | @@ -302,8 +302,8 @@ floatlinesCompositionObs + {*} longline.FloatlinesCompositionObs | reverseDbName |
| 302 | 302 |
hooksCompositionObs + {*} longline.HooksCompositionObs | reverseDbName=setObs
|
| 303 | 303 |
section + {*} longline.Section | unique orderBy=settingIdentifier reverseDbName=setObs
|
| 304 | 304 |
settingShape {*:1} referentiel.longline.SettingShape
|
| 305 |
-tdr + {*} longline.Tdr | reverseDbName=set
|
|
| 306 |
-catchLongline + {*} longline.CatchLongline | ordered reverseDbName=set
|
|
| 305 |
+tdr + {*} longline.Tdr | reverseDbName=setObs
|
|
| 306 |
+catchLongline + {*} longline.CatchLongline | ordered reverseDbName=setObs
|
|
| 307 | 307 |
lineType {*:0..1} referentiel.longline.LineType
|
| 308 | 308 |
lightsticksType {*:0..1} referentiel.longline.LightsticksType
|
| 309 | 309 |
lightsticksColor {*:0..1} referentiel.longline.LightsticksColor
|
| 1 |
+---
|
|
| 2 |
+-- #%L
|
|
| 3 |
+-- ObServe :: Persistence
|
|
| 4 |
+-- %%
|
|
| 5 |
+-- Copyright (C) 2008 - 2017 IRD, Code Lutin, Ultreia.io
|
|
| 6 |
+-- %%
|
|
| 7 |
+-- This program is free software: you can redistribute it and/or modify
|
|
| 8 |
+-- it under the terms of the GNU General Public License as
|
|
| 9 |
+-- published by the Free Software Foundation, either version 3 of the
|
|
| 10 |
+-- License, or (at your option) any later version.
|
|
| 11 |
+--
|
|
| 12 |
+-- This program is distributed in the hope that it will be useful,
|
|
| 13 |
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
+-- GNU General Public License for more details.
|
|
| 16 |
+--
|
|
| 17 |
+-- You should have received a copy of the GNU General Public
|
|
| 18 |
+-- License along with this program. If not, see
|
|
| 19 |
+-- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 |
+-- #L%
|
|
| 21 |
+---
|
|
| 22 |
+UPDATE OBSERVE_LONGLINE.Activity SET TOPIAID = replace(TOPIAID, 'ActivityLongline', 'ActivityLonglineObs');
|
|
| 23 |
+ALTER TABLE OBSERVE_LONGLINE.Activity RENAME TO ActivityObs;
|
|
| 24 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'ActivityLongline', 'ActivityLonglineObs');
|
|
| 25 |
+ |
|
| 26 |
+DROP INDEX IF EXISTS idx_observe_longline_encounter_activity;
|
|
| 27 |
+UPDATE OBSERVE_LONGLINE.Encounter SET ACTIVITY = replace(ACTIVITY, 'ActivityLongline', 'ActivityLonglineObs');
|
|
| 28 |
+ALTER TABLE OBSERVE_LONGLINE.Encounter ALTER COLUMN Activity RENAME TO ActivityObs;
|
|
| 29 |
+ALTER TABLE OBSERVE_LONGLINE.Encounter add constraint fk_Encounter_activityObs foreign key (activityObs) references OBSERVE_LONGLINE.ActivityObs;
|
|
| 30 |
+CREATE INDEX idx_observe_longline_encounter_activityObs ON OBSERVE_LONGLINE.Encounter(activityObs);
|
|
| 31 |
+ |
|
| 32 |
+DROP INDEX IF EXISTS idx_observe_longline_sensorused_activity;
|
|
| 33 |
+UPDATE OBSERVE_LONGLINE.SensorUsed SET ACTIVITY = replace(ACTIVITY, 'ActivityLongline', 'ActivityLonglineObs');
|
|
| 34 |
+ALTER TABLE OBSERVE_LONGLINE.SensorUsed ALTER COLUMN Activity RENAME TO ActivityObs;
|
|
| 35 |
+ALTER TABLE OBSERVE_LONGLINE.SensorUsed add constraint fk_SensorUsed_activityObs foreign key (activityObs) references OBSERVE_LONGLINE.ActivityObs;
|
|
| 36 |
+CREATE INDEX idx_observe_longline_SensorUsed_activityObs ON OBSERVE_LONGLINE.SensorUsed(activityObs);
|
|
| 37 |
+ |
|
| 38 |
+UPDATE OBSERVE_LONGLINE.Set SET TOPIAID = replace(TOPIAID, 'SetLongline', 'SetLonglineObs');
|
|
| 39 |
+ALTER TABLE OBSERVE_LONGLINE.Set RENAME TO SetObs;
|
|
| 40 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'SetLongline', 'SetLonglineObs');
|
|
| 41 |
+ |
|
| 42 |
+DROP INDEX IF EXISTS idx_observe_longline_activity_set;
|
|
| 43 |
+UPDATE OBSERVE_LONGLINE.ActivityObs SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 44 |
+ALTER TABLE OBSERVE_LONGLINE.ActivityObs ALTER COLUMN Set RENAME TO SetObs;
|
|
| 45 |
+ALTER TABLE OBSERVE_LONGLINE.ActivityObs add constraint fk_activityObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 46 |
+CREATE INDEX idx_observe_longline_ActivityObs_setObs ON OBSERVE_LONGLINE.ActivityObs(setObs);
|
|
| 47 |
+ |
|
| 48 |
+DROP INDEX IF EXISTS idx_observe_longline_baitsCompositionObs_set;
|
|
| 49 |
+UPDATE OBSERVE_LONGLINE.BaitsComposition SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 50 |
+ALTER TABLE OBSERVE_LONGLINE.BaitsComposition ALTER COLUMN Set RENAME TO SetObs;
|
|
| 51 |
+ALTER TABLE OBSERVE_LONGLINE.BaitsComposition RENAME TO BaitsCompositionObs;
|
|
| 52 |
+ALTER TABLE OBSERVE_LONGLINE.BaitsCompositionObs add constraint fk_BaitsCompositionObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 53 |
+CREATE INDEX idx_observe_longline_BaitsCompositionObs_setObs ON OBSERVE_LONGLINE.BaitsCompositionObs(setObs);
|
|
| 54 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'BaitsComposition', 'BaitsCompositionObs');
|
|
| 55 |
+ |
|
| 56 |
+DROP INDEX IF EXISTS idx_observe_longline_basket_set;
|
|
| 57 |
+UPDATE OBSERVE_LONGLINE.Basket SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 58 |
+ALTER TABLE OBSERVE_LONGLINE.Basket ALTER COLUMN Set RENAME TO SetObs;
|
|
| 59 |
+ALTER TABLE OBSERVE_LONGLINE.Basket add constraint fk_Basket_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 60 |
+CREATE INDEX idx_observe_longline_Basket_setObs ON OBSERVE_LONGLINE.Basket(setObs);
|
|
| 61 |
+ |
|
| 62 |
+DROP INDEX IF EXISTS idx_observe_longline_branchlinesComposition_set;
|
|
| 63 |
+UPDATE OBSERVE_LONGLINE.BranchlinesComposition SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 64 |
+ALTER TABLE OBSERVE_LONGLINE.BranchlinesComposition ALTER COLUMN Set RENAME TO SetObs;
|
|
| 65 |
+ALTER TABLE OBSERVE_LONGLINE.BranchlinesComposition RENAME TO BranchlinesCompositionObs;
|
|
| 66 |
+ALTER TABLE OBSERVE_LONGLINE.BranchlinesCompositionObs add constraint fk_BranchlinesCompositionObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 67 |
+CREATE INDEX idx_observe_longline_BranchlinesCompositionObs_setObs ON OBSERVE_LONGLINE.BranchlinesCompositionObs(setObs);
|
|
| 68 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'BranchlinesComposition', 'BranchlinesCompositionObs');
|
|
| 69 |
+ |
|
| 70 |
+DROP INDEX IF EXISTS idx_observe_longline_catch_set;
|
|
| 71 |
+UPDATE OBSERVE_LONGLINE.Catch SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 72 |
+ALTER TABLE OBSERVE_LONGLINE.Catch ALTER COLUMN Set RENAME TO SetObs;
|
|
| 73 |
+ALTER TABLE OBSERVE_LONGLINE.Catch ALTER COLUMN Set_IDX RENAME TO SetObs_IDX;
|
|
| 74 |
+ALTER TABLE OBSERVE_LONGLINE.Catch add constraint fk_Catch_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 75 |
+CREATE INDEX idx_observe_longline_Catch_setObs ON OBSERVE_LONGLINE.Catch(setObs);
|
|
| 76 |
+ |
|
| 77 |
+DROP INDEX IF EXISTS idx_observe_longline_floatlinesComposition_set;
|
|
| 78 |
+UPDATE OBSERVE_LONGLINE.FloatlinesComposition SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 79 |
+ALTER TABLE OBSERVE_LONGLINE.FloatlinesComposition ALTER COLUMN Set RENAME TO SetObs;
|
|
| 80 |
+ALTER TABLE OBSERVE_LONGLINE.FloatlinesComposition RENAME TO FloatlinesCompositionObs;
|
|
| 81 |
+ALTER TABLE OBSERVE_LONGLINE.FloatlinesCompositionObs add constraint fk_FloatlinesCompositionObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 82 |
+CREATE INDEX idx_observe_longline_FloatlinesCompositionObs_setObs ON OBSERVE_LONGLINE.FloatlinesCompositionObs(setObs);
|
|
| 83 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'FloatlinesComposition', 'FloatlinesCompositionObs');
|
|
| 84 |
+ |
|
| 85 |
+DROP INDEX IF EXISTS idx_observe_longline_hooksComposition_set;
|
|
| 86 |
+UPDATE OBSERVE_LONGLINE.HooksComposition SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 87 |
+ALTER TABLE OBSERVE_LONGLINE.HooksComposition ALTER COLUMN Set RENAME TO SetObs;
|
|
| 88 |
+ALTER TABLE OBSERVE_LONGLINE.HooksComposition RENAME TO HooksCompositionObs;
|
|
| 89 |
+ALTER TABLE OBSERVE_LONGLINE.HooksCompositionObs add constraint fk_HooksCompositionObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 90 |
+CREATE INDEX idx_observe_longline_HooksCompositionObs_setObs ON OBSERVE_LONGLINE.HooksCompositionObs(setObs);
|
|
| 91 |
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET TYPE = replace(TYPE, 'HooksComposition', 'HooksCompositionObs');
|
|
| 92 |
+ |
|
| 93 |
+DROP INDEX IF EXISTS idx_observe_longline_section_set;
|
|
| 94 |
+UPDATE OBSERVE_LONGLINE.Section SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 95 |
+ALTER TABLE OBSERVE_LONGLINE.Section ALTER COLUMN Set RENAME TO SetObs;
|
|
| 96 |
+ALTER TABLE OBSERVE_LONGLINE.Section add constraint fk_Section_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 97 |
+CREATE INDEX idx_observe_longline_Section_setObs ON OBSERVE_LONGLINE.Section(setObs);
|
|
| 98 |
+ |
|
| 99 |
+DROP INDEX IF EXISTS idx_observe_longline_tdr_set;
|
|
| 100 |
+UPDATE OBSERVE_LONGLINE.Tdr SET SET = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 101 |
+ALTER TABLE OBSERVE_LONGLINE.Tdr ALTER COLUMN Set RENAME TO SetObs;
|
|
| 102 |
+ALTER TABLE OBSERVE_LONGLINE.Tdr add constraint fk_Tdr_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 103 |
+CREATE INDEX idx_observe_longline_Tdr_setObs ON OBSERVE_LONGLINE.tdr(setObs);
|
|
| 104 |
+ |
|
| 105 |
+UPDATE OBSERVE_LONGLINE.mitigationtype_set SET Set = replace(SET, 'SetLongline', 'SetLonglineObs');
|
|
| 106 |
+ALTER TABLE OBSERVE_LONGLINE.mitigationtype_set ALTER COLUMN Set RENAME TO SetObs;
|
|
| 107 |
+ALTER TABLE OBSERVE_LONGLINE.mitigationtype_set add constraint fk_mitigationtype_setObs_setObs foreign key (setObs) references OBSERVE_LONGLINE.SetObs;
|
|
| 108 |
+CREATE INDEX idx_observe_longline_mitigationtype_setObs_setObs ON OBSERVE_LONGLINE.mitigationtype_set(setObs);
|
|
| 109 |
+ALTER TABLE OBSERVE_LONGLINE.mitigationtype_set RENAME TO mitigationtype_setObs;
|
| ... | ... | @@ -146,7 +146,7 @@ |
| 146 | 146 |
<devMode>true</devMode>
|
| 147 | 147 |
|
| 148 | 148 |
<!--Modèle version-->
|
| 149 |
- <observe.model.version>6.903</observe.model.version>
|
|
| 149 |
+ <observe.model.version>6.904</observe.model.version>
|
|
| 150 | 150 |
|
| 151 | 151 |
<!-- build timestamp configuration -->
|
| 152 | 152 |
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| ... | ... | @@ -236,17 +236,17 @@ public class ObserveFixtures { |
| 236 | 236 |
public static final ImmutableMap<String, Long> TRIP_LONGLINE_1_TABLES_COUNT = ImmutableMap
|
| 237 | 237 |
.<String, Long>builder()
|
| 238 | 238 |
.put("observe_longline.trip", 1L)
|
| 239 |
- .put("observe_longline.set", 13L)
|
|
| 240 |
- .put("observe_longline.activity", 13L)
|
|
| 239 |
+ .put("observe_longline.setobs", 13L)
|
|
| 240 |
+ .put("observe_longline.activityobs", 13L)
|
|
| 241 | 241 |
.put("observe_longline.gearusefeatures", 0L)
|
| 242 | 242 |
.put("observe_longline.gearusefeaturesmeasurement", 0L)
|
| 243 | 243 |
.put("observe_longline.encounter", 27L)
|
| 244 | 244 |
.put("observe_longline.sensorused", 0L)
|
| 245 | 245 |
.put("observe_longline.tdr", 0L)
|
| 246 |
- .put("observe_longline.baitscomposition", 13L)
|
|
| 247 |
- .put("observe_longline.floatlinescomposition", 65L)
|
|
| 248 |
- .put("observe_longline.hookscomposition", 39L)
|
|
| 249 |
- .put("observe_longline.branchlinescomposition", 13L)
|
|
| 246 |
+ .put("observe_longline.baitscompositionobs", 13L)
|
|
| 247 |
+ .put("observe_longline.floatlinescompositionobs", 65L)
|
|
| 248 |
+ .put("observe_longline.hookscompositionobs", 39L)
|
|
| 249 |
+ .put("observe_longline.branchlinescompositionobs", 13L)
|
|
| 250 | 250 |
.put("observe_longline.section", 234L)
|
| 251 | 251 |
.put("observe_longline.basket", 3042L)
|
| 252 | 252 |
.put("observe_longline.branchline", 18252L)
|
| ... | ... | @@ -256,23 +256,23 @@ public class ObserveFixtures { |
| 256 | 256 |
.put("observe_longline.weightmeasure", 0L)
|
| 257 | 257 |
.put("observe_longline.tdrrecord", 0L)
|
| 258 | 258 |
.put("observe_longline.species_tdr", 0L)
|
| 259 |
- .put("observe_longline.mitigationtype_set", 0L)
|
|
| 259 |
+ .put("observe_longline.mitigationtype_setobs", 0L)
|
|
| 260 | 260 |
.build();
|
| 261 | 261 |
|
| 262 | 262 |
public static final ImmutableMap<String, Long> TRIP_LONGLINE_2_TABLES_COUNT = ImmutableMap
|
| 263 | 263 |
.<String, Long>builder()
|
| 264 | 264 |
.put("observe_longline.trip", 1L)
|
| 265 |
- .put("observe_longline.set", 5L)
|
|
| 266 |
- .put("observe_longline.activity", 5L)
|
|
| 265 |
+ .put("observe_longline.setobs", 5L)
|
|
| 266 |
+ .put("observe_longline.activityobs", 5L)
|
|
| 267 | 267 |
.put("observe_longline.gearusefeatures", 0L)
|
| 268 | 268 |
.put("observe_longline.gearusefeaturesmeasurement", 0L)
|
| 269 | 269 |
.put("observe_longline.encounter", 3L)
|
| 270 | 270 |
.put("observe_longline.sensorused", 0L)
|
| 271 | 271 |
.put("observe_longline.tdr", 0L)
|
| 272 |
- .put("observe_longline.baitscomposition", 10L)
|
|
| 273 |
- .put("observe_longline.floatlinescomposition", 0L)
|
|
| 274 |
- .put("observe_longline.hookscomposition", 10L)
|
|
| 275 |
- .put("observe_longline.branchlinescomposition", 2L)
|
|
| 272 |
+ .put("observe_longline.baitscompositionobs", 10L)
|
|
| 273 |
+ .put("observe_longline.floatlinescompositionobs", 0L)
|
|
| 274 |
+ .put("observe_longline.hookscompositionobs", 10L)
|
|
| 275 |
+ .put("observe_longline.branchlinescompositionobs", 2L)
|
|
| 276 | 276 |
.put("observe_longline.section", 95L)
|
| 277 | 277 |
.put("observe_longline.basket", 1140L)
|
| 278 | 278 |
.put("observe_longline.branchline", 6840L)
|
| ... | ... | @@ -281,24 +281,24 @@ public class ObserveFixtures { |
| 281 | 281 |
.put("observe_longline.weightmeasure", 0L)
|
| 282 | 282 |
.put("observe_longline.tdrrecord", 0L)
|
| 283 | 283 |
.put("observe_longline.species_tdr", 0L)
|
| 284 |
- .put("observe_longline.mitigationtype_set", 0L)
|
|
| 284 |
+ .put("observe_longline.mitigationtype_setobs", 0L)
|
|
| 285 | 285 |
.put("observe_longline.catch_predator", 9L)
|
| 286 | 286 |
.build();
|
| 287 | 287 |
|
| 288 | 288 |
public static final ImmutableMap<String, Long> TRIP_LONGLINE_3_TABLES_COUNT = ImmutableMap
|
| 289 | 289 |
.<String, Long>builder()
|
| 290 | 290 |
.put("observe_longline.trip", 1L)
|
| 291 |
- .put("observe_longline.set", 14L)
|
|
| 292 |
- .put("observe_longline.activity", 14L)
|
|
| 291 |
+ .put("observe_longline.setobs", 14L)
|
|
| 292 |
+ .put("observe_longline.activityobs", 14L)
|
|
| 293 | 293 |
.put("observe_longline.gearusefeatures", 0L)
|
| 294 | 294 |
.put("observe_longline.gearusefeaturesmeasurement", 0L)
|
| 295 | 295 |
.put("observe_longline.encounter", 12L)
|
| 296 | 296 |
.put("observe_longline.sensorused", 0L)
|
| 297 | 297 |
.put("observe_longline.tdr", 0L)
|
| 298 |
- .put("observe_longline.baitscomposition", 14L)
|
|
| 299 |
- .put("observe_longline.floatlinescomposition", 36L)
|
|
| 300 |
- .put("observe_longline.hookscomposition", 42L)
|
|
| 301 |
- .put("observe_longline.branchlinescomposition", 14L)
|
|
| 298 |
+ .put("observe_longline.baitscompositionobs", 14L)
|
|
| 299 |
+ .put("observe_longline.floatlinescompositionobs", 36L)
|
|
| 300 |
+ .put("observe_longline.hookscompositionobs", 42L)
|
|
| 301 |
+ .put("observe_longline.branchlinescompositionobs", 14L)
|
|
| 302 | 302 |
.put("observe_longline.section", 243L)
|
| 303 | 303 |
.put("observe_longline.basket", 3229L)
|
| 304 | 304 |
.put("observe_longline.branchline", 19374L)
|
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type