liquibase can not inject options into a sql view (eg CREATE VIEW a WITH x AS b)
Description
CREATE TABLE dbo.testTable ( ID nchar(10) NOT NULL, TestDate datetime2(3) NULL ) go ALTER TABLE dbo.testTable ADD CONSTRAINT PK_testTable PRIMARY KEY( ID) go CREATE VIEW [dbo].[vw_test] WITH SCHEMABINDING AS SELECT TestDate, COUNT(1) AS Expr1 FROM dbo.testTable GROUP BY TestDate
liquibase diff this against an empty database, and you get a view that is not schema bound; the WITH tag was silently dropped.
in sql server only schema bound views can be indexed, dropping the with results in downstream failures to add a view.
–
recomendation: liquibase diff runs updateSQL and compares it's output to its input and have some type of tag to hold any noticed code irregularities so that code differences are noticed, rather than flaws in diff/update resulting in silent failures.; diff/update/diff should either not return anything, or emit some warnings somewhere along the line that irregular DDL was detected.
CREATE TABLE dbo.testTable
(
ID nchar(10) NOT NULL,
TestDate datetime2(3) NULL
)
go
ALTER TABLE dbo.testTable ADD CONSTRAINT
PK_testTable PRIMARY KEY( ID)
go
CREATE VIEW [dbo].[vw_test]
WITH SCHEMABINDING
AS
SELECT TestDate, COUNT(1) AS Expr1
FROM dbo.testTable
GROUP BY TestDate
liquibase diff this against an empty database, and you get a view that is not schema bound; the WITH tag was silently dropped.
in sql server only schema bound views can be indexed, dropping the with results in downstream failures to add a view.
–
recomendation: liquibase diff runs updateSQL and compares it's output to its input and have some type of tag to hold any noticed code irregularities so that code differences are noticed, rather than flaws in diff/update resulting in silent failures.; diff/update/diff should either not return anything, or emit some warnings somewhere along the line that irregular DDL was detected.