Hi,
The SQL generated when using nvarchar on MSSQL is not correct. Consider the following change sets
The only difference is the second change set contains a nvarchar instead of a varchar.
The sql generated by these two changesets are:
-
CREATE TABLE [schema_0514_kKJO].[TestChange1] (
[id] BIGINT CONSTRAINT DF_TestChange1_id DEFAULT NULL,
[name] VARCHAR(10) CONSTRAINT DF_TestChange1_name DEFAULT '' NOT NULL
)
CREATE TABLE [schema_0514_kKJO].[TestChange2] (
[id] BIGINT CONSTRAINT DF_TestChange2_id DEFAULT NULL,
[name] nvarchar(32) CONSTRAINT DF_TestChange2_name DEFAULT NOT NULL)
The second changeset throws the following exception:
-
Reason: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE [schema_0514_xe8z].[TestChange2] ([id] BIGINT CONSTRAINT DF_TestChange2_id DEFAULT NULL, [name] nvarchar(32) CONSTRAINT DF_TestChange2_name DEFAULT NOT NULL):
Caused By: Error executing SQL CREATE TABLE [schema_0514_xe8z].[TestChange2] ([id] BIGINT CONSTRAINT DF_TestChange2_id DEFAULT NULL, [name] nvarchar(32) CONSTRAINT DF_TestChange2_name DEFAULT NOT NULL):
Caused By: Incorrect syntax near the keyword 'NOT'.
In the case of the varchar, the default has an empty quote. This is missing in the nvarchar changeset, causing the error.
Hope you can get this fixed soon.
Thanks,
Alana