dropPrimaryKey without constraint name on sql server doesn't honour schema information

Description

I'm trying to drop a primary key from a table. The XML that I'm using in liquibase to accomplish that is:

The generated Query for SQL-Server looks like

and what's missing is the schema condition. If it should support any Schemaname the Query should look like:

select @pkname=o.name
from sysindexes i
join sysobjects o ON i.id = o.id
join sysobjects pk ON i.name = pk.name
AND pk.parent_obj = i.id
AND pk.xtype = 'PK'
join sysindexkeys ik on i.id = ik.id
AND i.indid = ik.indid
join syscolumns c ON ik.id = c.id
AND ik.colid = c.colid

INNER JOIN sysusers su ON o.uid = su.uid

where o.name = 'MY_TABLE'

and su.name = 'MY_SCHEMA'

This Bug affects the following class only

liquibase.sqlgenerator.core.DropPrimaryKeyGenerator

Let me know if you need any more information.

Environment

SQL-Server

Activity

Show:

Nathan Voxland January 7, 2015 at 3:42 PM

Applied SQL change. Thanks

Fixed

Details

Reporter

Components

Fix versions

Affects versions

Priority

Created December 16, 2014 at 4:15 PM
Updated June 5, 2015 at 8:51 AM
Resolved January 7, 2015 at 3:42 PM