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

Commits:

5 changed files:

Changes:

  • core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_0.java
    ... ... @@ -148,6 +148,13 @@ public class DataSourceMigrationForVersion_9_0 extends ByMajorMigrationVersionRe
    148 148
             }
    
    149 149
     
    
    150 150
             executor.addScript("21_0", "adapt_table_common_ocean");
    
    151
    +        if (withIds) {
    
    152
    +            // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2326
    
    153
    +            Set<String> existingCodes = executor.findMultipleResultAstSet(TopiaSqlQuery.wrap("SELECT code FROM ll_landing.DataSource WHERE code ='R Dogley'", resultSet -> resultSet.getString(1).toLowerCase()));
    
    154
    +            if (existingCodes.isEmpty()) {
    
    155
    +                executor.addScript("21_1", "add_ll_landing_datasource");
    
    156
    +            }
    
    157
    +        }
    
    151 158
             executor.addScript("98_0", "create_migrate_oneToOne");
    
    152 159
     
    
    153 160
             migrateOneToOneComposition(executor, "ll_observation", "activity", "set");
    

  • core/persistence/resources/src/main/resources/db/migration/v9/9.0/21_1_add_ll_landing_datasource-common.sql
    1
    +---
    
    2
    +-- #%L
    
    3
    +-- ObServe Core :: Persistence :: Resources
    
    4
    +-- %%
    
    5
    +-- Copyright (C) 2008 - 2022 IRD, 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 ll_landing.datasource(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ll.landing.DataSource#1651919221463#0.13484675401101676', 1, '2022-05-07 14:25:57.747', '2022-05-07 14:27:01.463', 'R Dogley', null, null, 'f', 1, 'Ruby Dogley (SFA Technician)', 'Ruby Dogley (Technicien SFA)', 'Ruby Dogley (SFA Technician)', null, null, null, null, null);

  • core/persistence/test/src/test/resources/fixtures/persistence/table_count/referential.properties
    ... ... @@ -64,7 +64,7 @@ ll_common.vesselActivity=27
    64 64
     ll_common.weightDeterminationMethod=1
    
    65 65
     ll_landing.company=40
    
    66 66
     ll_landing.conservation=3
    
    67
    -ll_landing.dataSource=20
    
    67
    +ll_landing.dataSource=21
    
    68 68
     ll_observation.baitHaulingStatus=5
    
    69 69
     ll_observation.encounterType=12
    
    70 70
     ll_observation.hookPosition=14
    

  • model/src/main/models/Observe/dto/class/decorator.properties
    ... ... @@ -22,7 +22,7 @@
    22 22
     GPSPoint=${time::timestamp}##${latitude}##${longitude}
    
    23 23
     data.ll.common.GearUseFeatures=${gear::label}##${number}
    
    24 24
     data.ll.common.GearUseFeaturesMeasurement=${gearCharacteristic::label}##${measurementValue}
    
    25
    -data.ll.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}##${vesselCode}##${activityObsSize}##${activityLogbookSize}##${sampleSize}
    
    25
    +data.ll.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}##${vesselCode}##( ${activityObsSize}##${activityLogbookSize}##${sampleSize}##${landingSize} )
    
    26 26
     data.ll.landing.Landing=${startDate::date}##${harbour::label}##${vessel::label}
    
    27 27
     data.ll.landing.LandingPart=${species::speciesLabel}##${categoryMin}##${categoryMax}##${weight}
    
    28 28
     data.ll.logbook.Activity=${startTimeStamp::timestamp}##${vesselActivity::label}
    

  • model/src/main/resources/fixtures/global.properties
    ... ... @@ -25,4 +25,4 @@ REFERENCE_DATA_COUNT=66
    25 25
     ENTITIES_LIMIT_SIZE=100
    
    26 26
     # fr.ird.observe.services.service.referential.ReferentialService
    
    27 27
     # fr.ird.observe.services.local.service.referential.DifferentialModelTest
    
    28
    -REFERENTIAL_COUNT=4070
    28
    +REFERENTIAL_COUNT=4071