Hi,
I’m creating a SQL changeset file that that alters a view. This alteration adds an outer apply to the query in the following manner:
CREATE OR ALTER VIEW [dbo].[PurchaseOrderView] AS
SELECT
Po.ID AS Id,
Po.Number AS PoNumber,
...
CAST(CASE WHEN EXISTS(
SELECT * FROM dbo.tblChangeAcc AS ca
LEFT JOIN tblChange c ON c.Id = ca.ChangeId
LEFT JOIN tblChangeSet cs ON cs.Id = c.ChangeSetId
WHERE cs.Id = Po.ChangeSetId
) THEN 1 ELSE 0 END AS BIT) AS IsModified,
...
FROM PurchaseOrders AS Po
...
OUTER APPLY (
select top 1 [UtcDate] lastChange, UserId, UserId
FROM dbo.tblChange
WHERE (ChangeSetId = po.ChangeSetId)
order by [UtcDate] desc
) as Change
...
GO
When running the updateSql
command to just this update, Liquibase parses and logs the preview of the changes that are going to be perform correctly.
However, when I add the following rollback code:
--rollback CREATE OR ALTER VIEW [dbo].[PurchaseOrderView] AS
--rollback SELECT
--rollback Po.ID AS Id,
--rollback Po.Number AS PoNumber,
--rollback ...
--rollback CAST(CASE WHEN EXISTS(
--rollback SELECT * FROM dbo.tblChangeAcc AS ca
--rollback LEFT JOIN tblChange c ON c.Id = ca.ChangeId
--rollback LEFT JOIN tblChangeSet cs ON cs.Id = c.ChangeSetId
--rollback WHERE cs.Id = Po.ChangeSetId
--rollback ) THEN 1 ELSE 0 END AS BIT) AS IsModified,
--rollback ...
--rollback FROM PurchaseOrders AS Po
--rollback ...
--rollback
--rollback GO
The following error appears:
ERROR: Exception Details
ERROR: Exception Primary Class: ChangeLogParseException
ERROR: Exception Primary Reason: ‘changesetId’ not set in rollback block
Looking at the documentation I found the parameter --changelog-parse-mode
, that when changed to LAX
“continues with the parsing when encountering unknown fields in changelog files”. But I’m not sure if this is the correct use for that parameter.
Is changesetId
a reserved word in the rollback parsing? Is there an option or workaround to this issue?