Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 0489d55e by Tony Chemit at 2022-05-07T14:57:01+02:00 Standardiser l'affichage des statistiques LL dans l'arbre - Closes #2328 - - - - - c5dd994e by Tony Chemit at 2022-05-08T08:38:52+02:00 Intégrer cette référence ll_landing.dataSource dans la migration 9.0.0 - Closes ultreiaio/ird-observe#2326 - - - - - 5 changed files: - core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_0.java - + core/persistence/resources/src/main/resources/db/migration/v9/9.0/21_1_add_ll_landing_datasource-common.sql - core/persistence/test/src/test/resources/fixtures/persistence/table_count/referential.properties - model/src/main/models/Observe/dto/class/decorator.properties - model/src/main/resources/fixtures/global.properties 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 } executor.addScript("21_0", "adapt_table_common_ocean"); + if (withIds) { + // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2326 + Set<String> existingCodes = executor.findMultipleResultAstSet(TopiaSqlQuery.wrap("SELECT code FROM ll_landing.DataSource WHERE code ='R Dogley'", resultSet -> resultSet.getString(1).toLowerCase())); + if (existingCodes.isEmpty()) { + executor.addScript("21_1", "add_ll_landing_datasource"); + } + } executor.addScript("98_0", "create_migrate_oneToOne"); 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 ===================================== @@ -0,0 +1,22 @@ +--- +-- #%L +-- ObServe Core :: Persistence :: Resources +-- %% +-- Copyright (C) 2008 - 2022 IRD, 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 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 ll_common.weightDeterminationMethod=1 ll_landing.company=40 ll_landing.conservation=3 -ll_landing.dataSource=20 +ll_landing.dataSource=21 ll_observation.baitHaulingStatus=5 ll_observation.encounterType=12 ll_observation.hookPosition=14 ===================================== model/src/main/models/Observe/dto/class/decorator.properties ===================================== @@ -22,7 +22,7 @@ GPSPoint=${time::timestamp}##${latitude}##${longitude} data.ll.common.GearUseFeatures=${gear::label}##${number} data.ll.common.GearUseFeaturesMeasurement=${gearCharacteristic::label}##${measurementValue} -data.ll.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}##${vesselCode}##${activityObsSize}##${activityLogbookSize}##${sampleSize} +data.ll.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}##${vesselCode}##( ${activityObsSize}##${activityLogbookSize}##${sampleSize}##${landingSize} ) data.ll.landing.Landing=${startDate::date}##${harbour::label}##${vessel::label} data.ll.landing.LandingPart=${species::speciesLabel}##${categoryMin}##${categoryMax}##${weight} data.ll.logbook.Activity=${startTimeStamp::timestamp}##${vesselActivity::label} ===================================== model/src/main/resources/fixtures/global.properties ===================================== @@ -25,4 +25,4 @@ REFERENCE_DATA_COUNT=66 ENTITIES_LIMIT_SIZE=100 # fr.ird.observe.services.service.referential.ReferentialService # fr.ird.observe.services.local.service.referential.DifferentialModelTest -REFERENTIAL_COUNT=4070 +REFERENTIAL_COUNT=4071 View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a3804063430b281f03211d738... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a3804063430b281f03211d738... You're receiving this email because of your account on gitlab.com.