dropDefaultValue does not work on SQL Server

Description

The dropDefaultValue command does not work on SQL Server because LiquiBase does not retrieve the corresponding constraint correctly from the database.

This is the way LiquiBase tries to delete the default value:

DECLARE @default sysname
SELECT @default = object_name(default_object_id) FROM sys.columns WHERE object_id=object_id('null.STFPRD_PRODUCTITEM') AND name='INCOMPLETE';
EXEC ('ALTER TABLE [dbo].[STFPRD_PRODUCTITEM] DROP CONSTRAINT ' + @default)

The problem is that LiquiBase uses 'null' as the schema name when trying to retrieve the constraint name, but it should be 'dbo' in this example.
If i change "object_id('null.STFPRD_PRODUCTITEM')" to "object_id('dbo.STFPRD_PRODUCTITEM')" and execute the statements manually, the default value is dropped correctly.

Environment

Win 7 x64, SQL Server 2012

Status

Reporter

Marco Perazzo

Fix versions

Affects versions

Priority

Blocker
Configure