Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

6 changed files:

Changes:

  • persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
    ... ... @@ -69,6 +69,9 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
    69 69
             }
    
    70 70
             executor.removeFK("observe_longline", "Trip", "tripType");
    
    71 71
             executor.addScript("05", "rename_tripType");
    
    72
    +        if (withIds) {
    
    73
    +            executor.addScript("06", "fill_vessel_activity");
    
    74
    +        }
    
    72 75
         }
    
    73 76
     
    
    74 77
     }
    

  • persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql
    1
    +---
    
    2
    +-- #%L
    
    3
    +-- ObServe :: Persistence
    
    4
    +-- %%
    
    5
    +-- Copyright (C) 2008 - 2018 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
    +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');
    
    23
    +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');
    
    24
    +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');
    
    25
    +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');
    
    26
    +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');
    
    27
    +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');
    
    28
    +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');
    
    29
    +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
    ... ... @@ -322,7 +322,7 @@ public class ObserveFixtures {
    322 322
                 .put("observe_longline.sensortype", 4L)
    
    323 323
                 .put("observe_longline.settingshape", 6L)
    
    324 324
                 .put("observe_longline.stomacfullness", 7L)
    
    325
    -            .put("observe_longline.vesselactivity", 5L)
    
    325
    +            .put("observe_longline.vesselactivity", 12L)
    
    326 326
                 .build();
    
    327 327
     
    
    328 328
         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.