Insert value defined in JSON changelog is ignored
Description
Environment
Java (1.8), Maven (3.3.9) and PostgreSQL (9.5.4).
Activity
Show:
FernandoC December 9, 2016 at 10:27 PMEdited
I found a similar error related to YAML changelog format.
Details
Details
Created December 9, 2016 at 4:27 PM
Updated December 9, 2016 at 10:28 PM
The second changeset in the following json changelog file contains a single insert command, but is not working as expected:
{ "databaseChangeLog": [ { "preConditions": [ { "dbms": { "type": "postgresql" }, "runningAs": { "username": "postgres" } } ] }, { "changeSet": { "id": "1", "author": "fernando.costa", "changes": [ { "createTable": { "tableName": "contact", "columns": [ { "column": { "name": "id", "type": "bigint", "autoIncrement": true, "constraints": { "primaryKey": true, "nullable": false } } }, { "column": { "name": "first_name", "type": "varchar(100)", "constraints": { "nullable": false } } } ] } } ] } }, { "changeSet": { "id": "2", "author": "fernando.costa", "changes": [ { "insert": { "tableName": "contact", "columns": [ { "column": { "name": "first_name", "value": "'George'" } } ] } } ] } } ] }
It throws this error:
I set first_name to George, but Liquibase seems to ignore it and generates a SQL statement with a NULL value.