I can't find in the documentation the right syntax to declare rollback statements using YAML, so I tried the following but it doesn't work.
When I execute the command
Anyone can help me?
Thank you.
- databaseChangeLog:
- - changeSet:
- id: 1
- author: foobar
- changes:
- - createTable:
- tableName: users
- columns:
- - column:
- name: id
- type: int
- autoIncrement: true
- constraints:
- primaryKey: true
- nullable: false
- - column:
- name: name
- type: varchar(50)
- constraints:
- nullable: false
- - column:
- name: email
- type: varchar(50)
- constraints:
- nullable: false
- - changeSet:
- id: 2
- author: foobar
- changes:
- - insert:
- tableName: users
- columns:
- - column:
- name: name
- value: John Brown
- - column:
- name: email
- value: john@example.com
- rollback:
- - sql:
- sql: TRUNCATE TABLE users;
When I execute the command
- liquibase --changeLogFile=input.yaml update
- Liquibase Update Successful
- liquibase --changeLogFile=input.yaml rollbackCountSql 1
- Liquibase rollbackCountSql Failed: liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.InsertDataChange created
Anyone can help me?
Thank you.