nvarchar error on mssql

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

What version of liquibase are you running against?

Nathan

I am using 2.0 build 202.

Thanks,
Alana

I created http://liquibase.jira.com/browse/CORE-614, it will be fixed for the next 2.0 RC

Nathan

I upload a patch in current 2.0 trunk http://ci.ops4j.org/browse/LQB-DEF/latest/artifact
Can you try if it works?