From b4c9da50b59b7d89c6ebb2920e6eba28711f17a0 Mon Sep 17 00:00:00 2001 From: chasegawa Date: Tue, 20 Sep 2022 12:44:08 -0700 Subject: [PATCH] SHIBUI-2397 Change to shib config table - making description a lob --- .../properties/ShibConfigurationProperty.java | 4 +++ .../main/resources/db/changelog/changelog.sql | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/shib/properties/ShibConfigurationProperty.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/shib/properties/ShibConfigurationProperty.java index 69e860302..39a964e86 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/shib/properties/ShibConfigurationProperty.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/shib/properties/ShibConfigurationProperty.java @@ -3,12 +3,14 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import edu.internet2.tier.shibboleth.admin.util.EmptyStringToNullConverter; import lombok.Data; +import org.hibernate.annotations.Type; import org.hibernate.envers.Audited; import javax.persistence.Column; import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Lob; import java.util.UUID; @Entity(name = "shib_configuration_prop") @@ -30,6 +32,8 @@ public class ShibConfigurationProperty { String defaultValue; @Column(name = "description") + @Lob + @Type(type = "org.hibernate.type.TextType") @Convert(converter = EmptyStringToNullConverter.class) String description; diff --git a/backend/src/main/resources/db/changelog/changelog.sql b/backend/src/main/resources/db/changelog/changelog.sql index c213f3952..c98abe7f4 100644 --- a/backend/src/main/resources/db/changelog/changelog.sql +++ b/backend/src/main/resources/db/changelog/changelog.sql @@ -206,3 +206,33 @@ ALTER TABLE description ALTER COLUMN description_value TEXT; GO ALTER TABLE description_aud ALTER COLUMN description_value TEXT; GO + +-- changeset liquibase:1.13.2.1 dbms:mariadb,mysql +-- preconditions onFail:MARK_RAN +-- precondition-sql-check expectedResult:1 SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = N'users' +-- comment: /* we don't need to run this if the system is new */ + +ALTER TABLE shib_configuration_prop MODIFY COLUMN description LONGTEXT; +GO +ALTER TABLE shib_configuration_prop_aud MODIFY COLUMN description LONGTEXT; +GO + +-- changeset liquibase:1.13.2.1 dbms:postgresql +-- preconditions onFail:MARK_RAN +-- precondition-sql-check expectedResult:1 SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = N'users' +-- comment: /* we don't need to run this if the system is new */ + +ALTER TABLE shib_configuration_prop ALTER COLUMN description TYPE TEXT; +GO +ALTER TABLE shib_configuration_prop_aud ALTER COLUMN description TYPE TEXT; +GO + +-- changeset liquibase:1.13.2.1 dbms:mssql +-- preconditions onFail:MARK_RAN +-- precondition-sql-check expectedResult:1 SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = N'users' +-- comment: /* we don't need to run this if the system is new */ + +ALTER TABLE shib_configuration_prop ALTER COLUMN description TEXT; +GO +ALTER TABLE shib_configuration_prop_aud ALTER COLUMN description TEXT; +GO \ No newline at end of file