# Rollback was executed successfully but nothing happens in database

**URL:** <https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550>\
**Category:** General Discussion\
**Tags:** rollback, docker\
**Created:** [November 21, 2022, 3:45pm UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550 "2022-11-21T15:45:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FreskimAliu](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@FreskimAliu](https://forum.liquibase.org/u/FreskimAliu)\
**Post date:** [November 21, 2022, 3:45pm UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/1 "2022-11-21T15:45:05Z")

</div>

I’m having an issue with Liquibase when I tried to rollback a changeset by tag. Rollback by count is working correctly.  
**Using** : Liquibase version _4.17.2_ and running it inside a docker container.

Changesets:

```auto
--liquibase formatted sql
--changeset freskim:testing-data
CREATE TABLE [dbo].[testingTable](
	[AlertProfileId] [int] NOT NULL,
	[ExternalUserId] [nvarchar](450) NOT NULL
) ON [PRIMARY];
--rollback drop table testingTable;

--changeset freskim:testing2-data
CREATE TABLE [dbo].[test2Table](
	[AlertProfileId] [int] NOT NULL,
	[ExternalUserId] [nvarchar](450) NOT NULL
) ON [PRIMARY];
--rollback drop table test2Table;

```

Master database changelog

```auto
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
	xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
	xmlns:pro="http://www.liquibase.org/xml/ns/pro"
	xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
		http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
		http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
		http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">

	<!-- TIVE : MSSQL TiveCacheDb : CHANGE LOG FILES -->
  	<includeAll path="schema-changelog" relativeToChangelogFile="true"></includeAll>

</databaseChangeLog>

```

I’m running liquibase using a Powershell:

```auto
param(
    [Parameter(Mandatory=$true)]
    [String]$Environment,
    [Parameter(Mandatory=$true)]
    [String]$LiquibaseTag,
    [Parameter(Mandatory=$true)]
    [String]$AWS_Profile,
    [Parameter(Mandatory=$true)]
    [String]$Region
)

# Stop the script if we run into errors
$ErrorActionPreference = "Stop"

Write-Host $MyInvocation.MyCommand.Path.

[String]$AccountId = aws sts get-caller-identity --query Account --profile $AWS_Profile --output text

$Repository = "${AccountId}.dkr.ecr.${Region}.amazonaws.com"
$BuildTag = "tive-liquibase:$Environment"

$ImagePath = "$Repository/$BuildTag"

 # Log in to ECR
aws ecr get-login-password --region $Region --profile $AWS_Profile | docker login --username AWS --password-stdin $Repository

$MyExitCode = $?
if (!$MyExitCode)
{
    Write-Host "Failed to login to ECR repository: $MyExitCode"
    exit $MyExitCode
}
#Pull Docker Image locally

docker pull $ImagePath

$MyExitCode = $?
if (!$MyExitCode)
{
    Write-Host "Failed to pull image from ECR repository: $MyExitCode"
    exit $MyExitCode
}
[String]$secrets = aws secretsmanager get-secret-value --secret-id liquibase-test `
    --query SecretString --output text --profile $AWS_Profile
$GetSecrets = ConvertFrom-Json $secrets

[String]$DatabaseHost = $GetSecrets.host
[String]$DatabasePort = $GetSecrets.port
[String]$Username = $GetSecrets.username
[String]$Password = $GetSecrets.password

#Rune Schema Rollback by Tag
Write-Host "Run Schema Rollback by Tag"

$Databases = @('TiveCacheDb')

foreach ($Database in $Databases) {
    $ChangeLogFile = "mssql/$Database/db.change-log.xml"
    $URL= "jdbc:sqlserver://${DatabaseHost}:${DatabasePort};databaseName=$Database;trustServerCertificate=true"

    docker run --rm -v $PWD/liquibase/changelog:/liquibase/changelog $ImagePath --url=$URL `
        --changeLogFile=$ChangeLogFile --driver=com.microsoft.sqlserver.jdbc.SQLServerDriver `
        --username=$Username --password=$Password rollback $LiquibaseTag
}
$MyExitCode = $?
if (!$MyExitCode)
{
    Write-Host "Failed to Rollback by Tag, reason: $MyExitCode"
    exit $MyExitCode
}

```

Here is the hierarchy of my files

 ![Screen Shot 2022-11-21 at 4.44.04 PM](https://us1.discourse-cdn.com/flex020/uploads/liquibase1/original/1X/4d16c32b38bd3aaf8f62009b39518ebff2f69ae3.png)

---

<div class="post-metadata">

**Author:** ![FreskimAliu](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@FreskimAliu](https://forum.liquibase.org/u/FreskimAliu)\
**Post date:** [November 21, 2022, 10:53pm UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/2 "2022-11-21T22:53:02Z")

</div>

Here is the results of my DATABASECHANGELOG table

 ![Screen Shot 2022-11-21 at 11.52.21 PM](https://us1.discourse-cdn.com/flex020/uploads/liquibase1/original/1X/f5719b48de19de65323be4bb5819cad735c65690.png)

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [November 29, 2022, 5:24pm UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/3 "2022-11-29T17:24:16Z")

</div>

What tag are you trying to roll back to? tag2 or initial-database-changes ?

Nathan

---

<div class="post-metadata">

**Author:** ![FreskimAliu](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@FreskimAliu](https://forum.liquibase.org/u/FreskimAliu)\
**Post date:** [November 30, 2022, 1:03am UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/4 "2022-11-30T01:03:12Z")

</div>

@nvoxland I tried to rollback to initial-database-changes

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [November 30, 2022, 6:15am UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/5 "2022-11-30T06:15:03Z")

</div>

That all seems like it should work. What is the output you get? Is it an error or what does it do?

Nathan

---

<div class="post-metadata">

**Author:** ![FreskimAliu](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@FreskimAliu](https://forum.liquibase.org/u/FreskimAliu)\
**Post date:** [December 5, 2022, 7:50pm UTC](https://forum.liquibase.org/t/rollback-was-executed-successfully-but-nothing-happens-in-database/7550/6 "2022-12-05T19:50:17Z")

</div>

Thanks a lot for your help, Nathan. I was trying to use my latest tag instead the previous tag when I wanted to rollback.
