Commit 4c2190ad authored by COTONNEC's avatar COTONNEC
Browse files

[fix] Remove async delete for trip

[fix] Fix compatibility with postgresql for PersonSpecifications
[fix] add changelof for postgresql
parent 2d4fd82d
......@@ -131,10 +131,10 @@ public interface PersonSpecifications extends ReferentialSpecifications<Person>
ParameterExpression<String> parameter = criteriaBuilder.parameter(String.class, FIRST_NAME_PARAMETER);
return criteriaBuilder.or(
criteriaBuilder.isNull(parameter),
criteriaBuilder.equal(criteriaBuilder.upper(root.get(Person.Fields.FIRST_NAME)), criteriaBuilder.upper(parameter))
criteriaBuilder.equal(criteriaBuilder.upper(root.get(Person.Fields.FIRST_NAME)), parameter)
);
});
specification.addBind(FIRST_NAME_PARAMETER, firstName);
specification.addBind(FIRST_NAME_PARAMETER, firstName != null ? firstName.toUpperCase() : null);
return specification;
}
......@@ -143,10 +143,10 @@ public interface PersonSpecifications extends ReferentialSpecifications<Person>
ParameterExpression<String> parameter = criteriaBuilder.parameter(String.class, LAST_NAME_PARAMETER);
return criteriaBuilder.or(
criteriaBuilder.isNull(parameter),
criteriaBuilder.equal(criteriaBuilder.upper(root.get(Person.Fields.LAST_NAME)), criteriaBuilder.upper(parameter))
criteriaBuilder.equal(criteriaBuilder.upper(root.get(Person.Fields.LAST_NAME)), parameter)
);
});
specification.addBind(LAST_NAME_PARAMETER, lastName);
specification.addBind(LAST_NAME_PARAMETER, lastName != null ? lastName.toUpperCase() : null);
return specification;
}
......
<?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-1.8.7.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="benoit.lavenier@e-is.pro" id="1619445031800-200" runOnChange="true">
<delete tableName="SYSTEM_VERSION">
<where>LABEL='1.8.7'</where>
</delete>
<insert tableName="SYSTEM_VERSION">
<column name="ID" valueComputed="nextval('system_version_seq')"/>
<column name="LABEL">1.8.7</column>
<column name="DESCRIPTION">
</column>
<column name="CREATION_DATE" valueComputed="current_timestamp"/>
<column name="UPDATE_DATE" valueComputed="current_timestamp"/>
<column name="COMMENTS">
</column>
</insert>
</changeSet>
</databaseChangeLog>
<?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-1.8.8.xml">
<property name="sqlCheck.not_empty.sql" value="SELECT COUNT(*) FROM STATUS WHERE ID=1"/>
<property name="sqlCheck.not_empty.expectedResult" value="1"/>
<changeSet author="ludovic.pecquot@e-is.pro" id="1619445032000-1">
<preConditions onFail="MARK_RAN">
<and>
<not><columnExists tableName="software" columnName="description"/></not>
<not><columnExists tableName="software" columnName="comments"/></not>
</and>
</preConditions>
<addColumn tableName="software">
<column name="description" type="VARCHAR(255)"/>
<column name="comments" type="VARCHAR(2000)"/>
</addColumn>
</changeSet>
<!-- update SYSTEM_VERSION -->
<changeSet author="benoit.lavenier@e-is.pro" id="1619445032000-200" runOnChange="true">
<delete tableName="SYSTEM_VERSION">
<where>LABEL='1.8.8'</where>
</delete>
<insert tableName="SYSTEM_VERSION">
<column name="ID" valueComputed="nextval('system_version_seq')"/>
<column name="LABEL">1.8.8</column>
<column name="DESCRIPTION">
- SOFTWARE: Add columns DESCRIPTION and COMMENTS
</column>
<column name="CREATION_DATE" valueComputed="current_timestamp"/>
<column name="UPDATE_DATE" valueComputed="current_timestamp"/>
<column name="COMMENTS">
</column>
</insert>
</changeSet>
</databaseChangeLog>
......@@ -12,4 +12,8 @@
stripComments="true"/>
</changeSet>
<include relativeToChangelogFile="true" file="db-changelog-1.8.7.xml"/>
<include relativeToChangelogFile="true" file="db-changelog-1.8.8.xml"/>
</databaseChangeLog>
......@@ -6,11 +6,11 @@ spring.jpa.database-platform=org.hibernate.spatial.dialect.postgis.PostgisDialec
spring.jpa.properties.hibernate.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect
# Database connection
spring.datasource.platform=oracle
spring.datasource.username=<USERNAME>
spring.datasource.password=
spring.datasource.platform=pgsql
spring.datasource.username=sumaris
spring.datasource.password=sumaris
spring.jpa.properties.hibernate.default_catalog=${spring.datasource.username}
spring.jpa.properties.hibernate.default_schema=public
spring.datasource.url=jdbc:postgresql://localhost:5432/sumaristest
spring.datasource.url=jdbc:postgresql://localhost:5432/sumaris
......@@ -391,7 +391,7 @@ public class DataGraphQLService {
@GraphQLMutation(name = "deleteTrips", description = "Delete many trips")
@IsUser
public void deleteTrips(@GraphQLNonNull @GraphQLArgument(name = "ids") List<Integer> ids) {
tripService.asyncDelete(ids);
tripService.delete(ids);
}
@GraphQLSubscription(name = "updateTrip", description = "Subscribe to changes on a trip")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment