DATABASECHANGELOGLOCK created multiple times in updateSQL mode #2295
Labels
BBroad
Broad Issue
BKeyPlatform
Key Platform
DATABASECHANGELOGLOCK
DBMSSQLServer
ImpactMedium
IntegrationAny
Severity2
TypeBug
Projects
Milestone
Environment
Liquibase Version: 4.6.2
Database Vendor & Version: Microsoft SQL Server 15.0.2080
Operating System Type & Version: Windows 10 Enterprise 21H1
Description
When running hte Liquibase configuration against a clean database in updateSQL to create a full database model deployment script, the "CREATE TABLE DATABASECHANGELOGLOCK" is generated in total 20 times. This only happens since 4.6.2, with 4.6.1 everything was fine regarding this issue.
Steps to reproduce
Liquibase configuration:
databaseChangeLog:
id: createTable-1
author: test
changes:
tableName: table1
columns:
name: test
type: int
Batch file used for compiling:
@echo OFF
CALL runLiquibase.bat ^
--defaultsFile=./test_sqlserver.properties ^
--changeLogFile=./test.yml ^
--outputFile=./test.sql ^
--logLevel=ERROR ^
updateSQL
PAUSE
Properties file structure:
url: jdbc:sqlserver://localhost:1433;databaseName=
username:
password:
driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath: /mssql-jdbc-9.4.0.jre8.jar
outputDefaultCatalog: false
liquibase.hub.mode=off
Result:
-- Create Database Lock Table
CREATE TABLE DATABASECHANGELOGLOCK (ID int NOT NULL, LOCKED bit NOT NULL, LOCKGRANTED datetime2(3), LOCKEDBY nvarchar(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))
GO
-- Initialize Database Lock Table
DELETE FROM DATABASECHANGELOGLOCK
GO
INSERT INTO DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0)
GO
-- Create Database Lock Table
CREATE TABLE DATABASECHANGELOGLOCK (ID int NOT NULL, LOCKED bit NOT NULL, LOCKGRANTED datetime2(3), LOCKEDBY nvarchar(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))
GO
-- Initialize Database Lock Table
DELETE FROM DATABASECHANGELOGLOCK
GO
INSERT INTO DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0)
GO
[...]
You can find the used test setup here:
test.zip
The text was updated successfully, but these errors were encountered: