I am trying to define a changeSet to insert two rows in a table using liquibase. In order to do this, I wrote the following changeSet:
- changeSet:
id: 1.0/7
author: stivlo
changes:
-insert:
tableName: my_table
columns:
- column:
name: id
value: "1"
- column:
name: name
value: "One"
-insert:
tableName: my_table
columns:
- column:
name: id
value: "2"
- column:
name: name
value: "Two"
When I start my Spring Boot application, the changeset is executed, but the rows are not inserted.
In DATABASECHANGELOG table I find a raw saying that the migration was executed, but the description is "Empty", as to signify that liquibase could not see any changes in the migration.
How do I fix my yaml in order to be able to insert those two rows?
P.S. I've managed to solve my problem embedding SQL statements instead of using a liquibase insert.
- changeSet:
id: 1.0/7
author: stivlo
changes:
- sql:
sql: insert into my_table (id, name) values (1, "One")
- sql:
sql: insert into my_table (id, name) values (2, "Two")
This works, but I am still interested to know how to properly define a liquibase insert. Thank you.