Skip to content

Commit

Permalink
Also change test databasestorage type to bytea for postgresql (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsm5 authored Oct 1, 2024
1 parent f488a85 commit 7c46a0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/main/resources/ladybug/DatabaseChangelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
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-4.26.xsd"
>
<property name="BLOB_FIELD_TYPE" value="bytea" dbms="postgresql"/>
<property name="BLOB_FIELD_TYPE" value="blob" dbms="!postgresql"/>

<!--
Separate changelog files to make it possible to only use one of them when either debug storage or test storage is
not configured as a database storage
-->
<include file="ladybug/DatabaseChangelog_Debug.xml"/>
<include file="ladybug/DatabaseChangelog_Debug.xml"/>
<include file="ladybug/DatabaseChangelog_Test.xml"/>

<include file="ladybug/DatabaseChangelog_Custom.xml" errorIfMissing="false"/>
</databaseChangeLog>
4 changes: 1 addition & 3 deletions src/main/resources/ladybug/DatabaseChangelog_Debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
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-4.26.xsd"
>
<property name="BLOB_FIELD_TYPE" value="bytea" dbms="postgresql"/>
<property name="BLOB_FIELD_TYPE" value="blob" dbms="!postgresql"/>

<changeSet id="Ladybug:1" author="Jaco de Groot" failOnError="false">
<comment>Add table LADYBUG</comment>
Expand All @@ -20,7 +18,7 @@
<column name="NUMBEROFCHECKPOINTS" type="INTEGER"/>
<column name="ESTIMATEDMEMORYUSAGE" type="BIGINT"/>
<column name="STORAGESIZE" type="BIGINT"/>
<column name="REPORT" type="BLOB"/>
<column name="REPORT" type="${BLOB_FIELD_TYPE}"/>
<column name="REPORTXML" type="CLOB"/>
</createTable>
<createSequence sequenceName="SEQ_LADYBUG"/><!-- To auto increment STORAGEID on Oracle -->
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/ladybug/DatabaseChangelog_Test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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-4.26.xsd"
>

<changeSet id="LadybugTest:1" author="Jaco de Groot">
<comment>Add table LADYBUGTEST</comment>
<createTable tableName="LADYBUGTEST">
Expand All @@ -11,7 +12,7 @@
</column>
<column name="PATH" type="VARCHAR(4000)"/><!-- 4000 is the maximum VARCHAR length for Oracle. Linux has a maximum path of 4096 characters for most filesystems (https://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs) -->
<column name="NAME" type="VARCHAR(256)"/>
<column name="REPORT" type="BLOB"/>
<column name="REPORT" type="${BLOB_FIELD_TYPE}"/>
<column name="DESCRIPTION" type="CLOB"/>
</createTable>
<createSequence sequenceName="SEQ_LADYBUGTEST"/><!-- To auto increment STORAGEID on Oracle -->
Expand Down

0 comments on commit 7c46a0b

Please sign in to comment.