Rollback was executed successfully but nothing happens in database

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:

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

<?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:

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

Here is the results of my DATABASECHANGELOG table

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

Nathan

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

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

Nathan

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