I create a table and the data type of id is BINARY(16).
Then I create a trigger, to generate an id for each row.
- changeSet:
id: 1586934810000-1
author: qwe
changes:
- sql:
sql: create trigger ins_document_request_types before insert on document_request_types for each row set new.id = unhex(replace(uuid(), '-', ''));
- changeSet:
id: 1586934810000-5
author: michael-eb
runOnChange: true
changes:
- loadUpdateData:
columns:
- column:
name: name
type: STRING
file: db/changelog/data/document-request-types.csv
primaryKey: id
tableName: document_request_types
Then I load data from CSV file, it doesn't have id for each row. and I get an error: Field 'id' doesn't have a default value
All these steps are executed by Liquibase.
I have tried to insert a row by myself by the console of ubuntu, the trigger worked, but when I use IDEA to do same thing, it doesn't work.
Which step I did wrong? How to fix it?