Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: b227a2b3 by Tony CHEMIT at 2018-05-19T22:55:55Z Ajout de nouvelles entrées au référentiel observe_longline.VesselActivity - Closes #891 - - - - - 6 changed files: - persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java - + persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql - test/src/main/java/fr/ird/observe/test/ObserveFixtures.java - test/src/main/resources/db/8.0/dataForTestLongline.sql.gz - test/src/main/resources/db/8.0/dataForTestSeine.sql.gz - test/src/main/resources/db/8.0/referentiel.sql.gz Changes: ===================================== persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java ===================================== --- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java +++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java @@ -69,6 +69,9 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource } executor.removeFK("observe_longline", "Trip", "tripType"); executor.addScript("05", "rename_tripType"); + if (withIds) { + executor.addScript("06", "fill_vessel_activity"); + } } } ===================================== persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql ===================================== --- /dev/null +++ b/persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql @@ -0,0 +1,29 @@ +--- +-- #%L +-- ObServe :: Persistence +-- %% +-- Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io +-- %% +-- 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% +--- +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#01' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'CRUISE', 'Cruising', 'Route','Route #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#02' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'DRIFT', 'Drifting', 'En dérive','En dérive #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#03' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'PORT', 'At port', 'Au port','Au port #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#04' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'OUTZEE', 'Out of national EEZ', 'Hors ZEE nationale','Hors ZEE nationale #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#05' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'REPAIR', 'Under repair', 'En réparation','En réparation #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#06' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'TRANSSHIP', 'Transshipment', 'Transbordement','Transbordement #TODO'); +INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#07' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'UNK', 'Unknown', 'Inconnue','Inconnue #TODO'); +UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET LASTUPDATEDATE = CURRENT_TIMESTAMP WHERE TYPE ='fr.ird.observe.entities.referentiel.longline.VesselActivityLongline'; \ No newline at end of file ===================================== test/src/main/java/fr/ird/observe/test/ObserveFixtures.java ===================================== --- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java +++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java @@ -322,7 +322,7 @@ public class ObserveFixtures { .put("observe_longline.sensortype", 4L) .put("observe_longline.settingshape", 6L) .put("observe_longline.stomacfullness", 7L) - .put("observe_longline.vesselactivity", 5L) + .put("observe_longline.vesselactivity", 12L) .build(); public static final ImmutableMap<String, Long> REFERENTIAL_TABLES_COUNT = mergeResults( ===================================== test/src/main/resources/db/8.0/dataForTestLongline.sql.gz ===================================== The diff for this file was not included because it is too large. ===================================== test/src/main/resources/db/8.0/dataForTestSeine.sql.gz ===================================== The diff for this file was not included because it is too large. ===================================== test/src/main/resources/db/8.0/referentiel.sql.gz ===================================== The diff for this file was not included because it is too large. View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b227a2b3835786448c2b0185a2d2... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b227a2b3835786448c2b0185a2d2... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT