loadData behavior changed for text columns

Description

I documented this as a question on Stack Overflow originally

The Problem

I recently upgraded Liquibase to `3.6.2` from `3.4.2`.

Note: this issue was introduced in 3.6.0

Loading seed data from a CSV into text fields now results in a CLOB resource error. Before it would simply insert the text as a value.

The Setup

I'm using Liquibase to manage migrations of my data.

I have a table with an `code` and `description` column. `description` is of type `TEXT`.

<changeSet author="" id="create-table-degrees"> <createTable tableName="degrees"> <column name="code" type="varchar(2)"> <constraints primaryKey="true"/> </column> <column name="description" type="text"> <constraints unique="true"/> </column> </createTable> <rollback> <dropTable tableName="degrees"/> </rollback> </changeSet>

I have seed data in a CSV:

code,description "D1","MASTERS" "D2","DOCTORATE"

I load it using `loadData`:

<changeSet author="" id="seed-degrees"> <loadData file="seeds/degrees.csv" tableName="degrees" /> </changeSet>

The Error

Unexpected error running Liquibase: CLOB resource not found: MASTERS

The Question / Issue

The default behavior changed for loadData (meaning I will have to modify existing changeSets). I humbly request that this new feature of CLOB resources not replace the previous default but would instead be an option.

Environment

Gradle, OSX, gradle-plugin

Activity

Show:

Anver S December 3, 2018 at 9:07 PM

While adding an explicit column type definition as defined in original stackoverflow post

<column name="description" type="string" />

does the trick - for me it effectively requires to update already applied changesets which ideally I'd try to avoid.

Details

Reporter

Affects versions

Priority

Created July 22, 2018 at 10:40 PM
Updated December 3, 2018 at 9:07 PM

Flag notifications