question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to specify an Empty Rollback using SQL Dialect

See original GitHub issue

Environment

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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rorysaurcommented, Nov 3, 2022

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.

1reaction
filipelautertcommented, Nov 3, 2022

@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 .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found