New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Liquibase offline mode doesn't support rollbackSQL <tag>
operation
#2219
Labels
Projects
Milestone
Comments
msimko81
changed the title
Liquibase offline mode doesn't support rollback tag
Liquibase offline mode doesn't support Nov 17, 2021
rollbackSQL <tag>
operation
I dug to the source code. Here is a proposed quick fix (the required functionality was copied from
|
msimko81
pushed a commit
to msimko81/liquibase
that referenced
this issue
Nov 17, 2021
Fix for the `OfflineChangeLogHistoryService` - populate tag to the changelog. liquibase#2219
Opened pull request: #2222 |
Hi @msimko81 Thanks for alerting us to this issue. And thanks for creating a fix for it. We will add this to the list of issues that we are processing. |
molivasdat
added
BBroad
Broad Issue
DBAll
ImpactLow
IntegrationCLI
PRAssociated
Severity3
TypeBug
labels
Nov 30, 2021
Fixed by #2222 |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Environment
Liquibase Version:
4.6.1 (but also affecting previous versions)
Liquibase Integration & Version:
CLI & Java API
Database Vendor & Version:
MS SQL Server (but also affecting others)
Operating System Type & Version:
Ubuntu Linux (but also affecting others)
Description
The liquibase offline mode doesn't support
rollbackSQL <tag>
functionality. The reason is the tag value is not persisted in thedatabasechangelog.csv
as a result ofupdateSQL
operation. The tag column only contains empty values, also for changeset containingtagDatabase
command.Steps To Reproduce
Assume the following
changelog.xml
:liquibase --changeLogFile=changelog.xml --url=offline:mssql updateSQL
rollbackSQL <tag>
operation:liquibase --changeLogFile=changelog.xml --url=offline:mssql rollbackSQL 1.0
Actual Behavior
liquibasechangelog.csv
with two entries. The second one, with idrelease-1.0
, contains empty tag. However, the tag of this entry shall be1.0
(as is the state of the database table in corresponding online mode case).rollbackSQL
operation fails with the error message:Unexpected error running Liquibase: Could not find tag '1.0' in the database
.Note: if I manually change the CSV file generated by the first step and specify the tag for the second entry (to mimic the online mode behaviour), the second operation is successful and behaves as expected.
Expected/Desired Behavior
The tag value shall be populated in offline mode (i.e. present in
liquibasechangelog.csv
) in order to enablerollbackSQL <tag>
operation.Additional Context
The problem has been reported several times, but no answer up to date.
See e.g.
https://forum.liquibase.org/t/how-to-generate-a-sql-file-with-rollbacksql-with-offline-mode/3283
https://forum.liquibase.org/t/not-able-to-generate-rollback-scripts-by-tag-in-offline-mode/3909
The text was updated successfully, but these errors were encountered: