valueComputed does not work with valueBlobFile
See original GitHub issueEnvironment
Liquibase Version: 3.8.9
Liquibase Integration & Version: Gradle
Liquibase Extension(s) & Version:
Database Vendor & Version: PosgreSQL 10
Operating System Type & Version: Windows 10
Description
If I put in <insert>
change insert to table with two columns: valueComputed
and valueBlobFile
,
Liquibase always tries to insert null
to valueComputed
whatever I put in this attribute value.
Steps To Reproduce
- Create table with columns of types
uuid
andbytea
. - Create migration with
<insert>
change. - In that migration fill columns with
valueComputed="uuid_in(md5(random()::text || clock_timestamp()::text)::cstring)"
andvalueBlobFile="path/to/file"
Changeset that reproduces the issue
<changeSet author="mike" id="1"> <createTable tableName="TABLE_WITH_CLOB"> <column name="ID" type="java.sql.Types.BIGINT" autoIncrement="true"> <constraints nullable="false" primaryKey="true" /> </column> <column name="CONTENT" type="java.sql.Types.CLOB"> <constraints nullable="false" /> </column> <column name="UUIDCOL" type="uuid" /> </createTable> </changeSet> <changeSet author="mike" id="2"> <insert tableName="TABLE_WITH_CLOB"> <column name="ID" valueNumeric="1" /> <column name="CONTENT" valueClobFile="test-clob.txt" /> <column name="UUIDCOL" valueComputed="uuid_in(md5(random()::text || clock_timestamp()::text)::cstring)" /> </insert> </changeSet> <changeSet author="mike" id="3"> <update tableName="TABLE_WITH_CLOB"> <column name="UUIDCOL" valueComputed="uuid_in(md5(random()::text || clock_timestamp()::text)::cstring)" /> </update> </changeSet>
Actual Behavior
Liquibase migration crashes with message null value in column "id" violates not-null constraint
Expected/Desired Behavior
Migration passes successfully.
P.S.
I’ve found the related bug report here
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
Top GitHub Comments
Seems like I won’t get any feedback here 😕
I cannot reproduce this issue on below environment:
With below changelog:
and cannot reproduce this issue. Changelog execution output is as displayed below: