How to specify an Empty Rollback using SQL Dialect
See original GitHub issueEnvironment
Liquibase Version: 4.13 Liquibase Integration & Version: GitHub Action Liquibase Extension(s) & Version: 7 Database Vendor & Version: Snowflake Operating System Type & Version: Linux Infrastructure Type/Provider: Azure
Description
Unable to specify an empty rollback for a changeset using the SQL dialect.
Steps To Reproduce
Using a SQL dialect, consider a change set like:
-- liquibase formatted sql
-- changeset anthonyr:create-table-AW_TEST-1 runOnChange:true
create or replace table AW_TEST (
ID int not null autoincrement,
valueDate date not null
)
-- rollback
When I test a rollback, Liquibase throws an error:
Unexpected error running Liquibase: No inverse to liquibase.change.core.RawSQLChange created
I am legitimately OK with an empty rollback. Note that I don’t really see a SQL Example in the documentation.
Actual Behavior
When I test a rollback, Liquibase throws an error:
Unexpected error running Liquibase: No inverse to liquibase.change.core.RawSQLChange created
Expected/Desired Behavior
When I test a rollback, Liquibase should basically do nothing for this changeset since the rollback is empty.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Rolling back transactions via the ROLLBACK SQL query
You just have to write the statement ROLLBACK TRANSACTION, followed by the name of the transaction that you want to rollback.
Read more >liquibase rollback always rollsback to a clean empty database
1 Answer 1 ... I guess Liquibase starts rolling back and continues until it finds the specified label. So, I would check whether...
Read more >ROLLBACK
A ROLLBACK statement with a FORCE clause rolls back only the specified transaction. Such a statement does not affect your current transaction. See...
Read more >Two Types of ROLLBACK Requests - Teradata Documentation
There are two categories of ROLLBACK requests, those that can be evaluated by the parser and do not require access to a table...
Read more >Liquibase Rollback Workflow
The intention of a rollback script is to return the database to a previous specified point in time. Note: Rollback support is available...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @filipelautert! Yes I should’ve mentioned that I saw the workaround in this thread and it worked for me 👍🏻 glad to hear it will be released soon.
@rorysaur sory for that, seems the documentation team jumped the gun on this one - this feature will be released in Liquibase 4.18 . Meanwhile you need to use an workaround as
-- rollback select 'N/A'
or something like that .