-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
186 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/adap/db-changelog-2.0.1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd" | ||
logicalFilePath="https://github.com/sumaris-net/sumaris-pod/blob/master/sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/adap/db-changelog-2.0.1.xml"> | ||
|
||
<property name="sqlCheck.empty.sql" value="SELECT count(*) FROM STATUS"/> | ||
<property name="sqlCheck.adap.sql" value="SELECT COUNT(*) FROM PROGRAM WHERE LABEL = 'ADAP-MER'"/> | ||
<property name="sqlCheck.adap.expectedResult" value="1"/> | ||
|
||
<preConditions onFail="WARN" onFailMessage="Database instance is not a ADAP database instance! Do not include this changelog file in the master file"> | ||
<or> | ||
<!-- Test if database is empty --> | ||
<sqlCheck expectedResult="0">${sqlCheck.empty.sql}</sqlCheck> | ||
<!-- OR if expected production database --> | ||
<sqlCheck expectedResult="${sqlCheck.adap.expectedResult}">${sqlCheck.adap.sql}</sqlCheck> | ||
</or> | ||
</preConditions> | ||
|
||
<!-- Add new option to set trips extraction sampling method, in RDB/COST extraction --> | ||
<changeSet author="[email protected]" id="1648229099998-402" runOnChange="true"> | ||
<preConditions onFail="MARK_RAN"> | ||
<and> | ||
<sqlCheck expectedResult="${sqlCheck.adap.expectedResult}">${sqlCheck.adap.sql}</sqlCheck> | ||
<sqlCheck expectedResult="0"> | ||
SELECT COUNT(*) FROM PROGRAM_PROPERTY WHERE LABEL in ( | ||
'sumaris.trip.extraction.sampling.method') | ||
AND PROGRAM_FK = (SELECT ID FROM PROGRAM WHERE LABEL = 'ADAP-MER')</sqlCheck> | ||
</and> | ||
</preConditions> | ||
<insert tableName="PROGRAM_PROPERTY"> | ||
<column name="ID" valueComputed="NEXT VALUE FOR PROGRAM_PROPERTY_SEQ"/> | ||
<column name="LABEL">sumaris.trip.extraction.sampling.method</column> | ||
<column name="NAME">SelfSampling</column> | ||
<column name="PROGRAM_FK" valueComputed="(SELECT ID FROM PROGRAM WHERE LABEL = 'ADAP-MER')"/> | ||
<column name="STATUS_FK" valueNumeric="1"/> | ||
<column name="CREATION_DATE" valueComputed="sysdate"/> | ||
<column name="UPDATE_DATE" valueComputed="current_timestamp"/> | ||
</insert> | ||
</changeSet> | ||
</databaseChangeLog> |
52 changes: 52 additions & 0 deletions
52
sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/db-changelog-2.0.1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!-- | ||
~ #%L | ||
~ SUMARiS | ||
~ %% | ||
~ Copyright (C) 2019 SUMARiS Consortium | ||
~ %% | ||
~ 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% | ||
--> | ||
|
||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd" | ||
logicalFilePath="https://github.com/sumaris-net/sumaris-pod/blob/master/sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/db-changelog-2.0.1.xml"> | ||
|
||
<property name="sqlCheck.not_empty.sql" value="SELECT COUNT(*) FROM STATUS WHERE ID=1"/> | ||
<property name="sqlCheck.not_empty.expectedResult" value="1"/> | ||
|
||
|
||
<!-- update SYSTEM_VERSION --> | ||
<changeSet author="[email protected]" id="1648229099998-200" runOnChange="true"> | ||
<delete tableName="SYSTEM_VERSION"> | ||
<where>LABEL='2.0.1'</where> | ||
</delete> | ||
<insert tableName="SYSTEM_VERSION"> | ||
<column name="ID" valueComputed="NEXT VALUE FOR SYSTEM_VERSION_SEQ"/> | ||
<column name="LABEL">2.0.1</column> | ||
<column name="DESCRIPTION"> | ||
- Add an option for ADAP; | ||
</column> | ||
<column name="CREATION_DATE" valueComputed="current_timestamp"/> | ||
<column name="UPDATE_DATE" valueComputed="current_timestamp"/> | ||
<column name="COMMENTS"> | ||
- Add an option for ADAP; | ||
</column> | ||
</insert> | ||
</changeSet> | ||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters