From 20fe7ec7b85d84947ccb633dca1e81d2ae9fffde Mon Sep 17 00:00:00 2001 From: mposolda Date: Thu, 11 Jun 2015 16:56:25 +0200 Subject: [PATCH] Database fixes --- .../liquibase/custom/JpaUpdate1_2_0_CR1.java | 5 +++- .../META-INF/jpa-changelog-1.3.0.Beta1.xml | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java b/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java index 5c8a2eb9ad..00f9b0cd1e 100644 --- a/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java +++ b/connections/jpa-liquibase/src/main/java/org/keycloak/connections/jpa/updater/liquibase/custom/JpaUpdate1_2_0_CR1.java @@ -3,6 +3,7 @@ package org.keycloak.connections.jpa.updater.liquibase.custom; import java.sql.PreparedStatement; import java.sql.ResultSet; +import liquibase.datatype.DataTypeFactory; import liquibase.exception.CustomChangeException; import liquibase.statement.core.InsertStatement; import liquibase.structure.core.Table; @@ -17,7 +18,9 @@ public class JpaUpdate1_2_0_CR1 extends CustomKeycloakTask { String realmClientTableName = database.correctObjectName("REALM_CLIENT", Table.class); try { - PreparedStatement statement = jdbcConnection.prepareStatement("select CLIENT.REALM_ID, CLIENT.ID CLIENT_ID from CLIENT where CLIENT.CONSENT_REQUIRED = true"); + String trueValue = DataTypeFactory.getInstance().getTrueBooleanValue(database); + PreparedStatement statement = jdbcConnection.prepareStatement("select CLIENT.REALM_ID, CLIENT.ID CLIENT_ID from CLIENT where CLIENT.CONSENT_REQUIRED = " + trueValue); + try { ResultSet resultSet = statement.executeQuery(); try { diff --git a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.3.0.Beta1.xml b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.3.0.Beta1.xml index 86b9d75fa2..ba7adaac50 100755 --- a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.3.0.Beta1.xml +++ b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.3.0.Beta1.xml @@ -112,14 +112,17 @@ - + - UPDATE_PROFILE_FIRST_LOGIN = false + UPDATE_PROFILE_FIRST_LOGIN = :value + + + @@ -145,10 +148,10 @@ ACTION = 3 - - - - + + + + @@ -156,10 +159,10 @@ - - - - + + + +