You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
While migrating from MsSql DB version 2017 to newer 2019 or 2022 we find an issue with add/update table column comments.
So when using the docker DB image: mcr.microsoft.com/mssql/server:2019-CU21-ubuntu-20.04 with a default collation the change log executes normally
<setColumnRemarks tableName="test" columnName="id" remarks="some new comment"/>
In case we config DB with MSSQL_COLLATION: Latin1_General_CS_AS_KS
The same changelog fails with an error:
Caused by: liquibase.exception.DatabaseException: Property cannot be added. Property 'MS_Description' already exists for 'dbo.test.id'. [Failed SQL: (15233) IF EXISTS( SELECT extended_properties.value FROM sys.extended_properties WHERE major_id = OBJECT_ID('dbo.test') AND name = N'MS_DESCRIPTION' AND minor_id = ( SELECT column_id FROM sys.columns WHERE name = 'id' AND object_id = OBJECT_ID('dbo.test')) ) BEGIN EXEC sys.sp_updateextendedproperty @name = N'MS_Description' , @value = N'some new comment' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = test' , @level2type = N'COLUMN' , @level2name = N'id' END ELSE BEGIN EXEC sys.sp_addextendedproperty @name = N'MS_Description' , @value = N'some new comment' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'test' , @level2type = N'COLUMN' , @level2name = N'id' END;]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:470)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:179)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1291)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Property cannot be added. Property 'MS_Description' already exists for 'dbo.test.id'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
NOTE: an error appears only in case of updating. If the column didn't have the comment new remarks is set normally.
Steps To Reproduce
Create 2 sequences of the changeset. Create any column with comments and for a second create the changelog where you try to set a new column comment via
Search first
Description
Hi,
While migrating from MsSql DB version 2017 to newer 2019 or 2022 we find an issue with add/update table column comments.
So when using the docker DB image:
mcr.microsoft.com/mssql/server:2019-CU21-ubuntu-20.04
with a default collation the change log executes normallyIn case we config DB with
MSSQL_COLLATION: Latin1_General_CS_AS_KS
The same changelog fails with an error:
NOTE: an error appears only in case of updating. If the column didn't have the comment new remarks is set normally.
Steps To Reproduce
Create 2 sequences of the changeset. Create any column with comments and for a second create the changelog where you try to set a new column comment via
Expected/Desired Behavior
The column comment should be updated with any type of DB
collation
Liquibase Version
No response
Database Vendor & Version
MsSql 2019
Liquibase Integration
No response
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: