Skip to content

Commit

Permalink
DNN-4740 - Issue with CHECK constraint in Roles Table in WebMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
cnurse committed Jan 28, 2014
1 parent 3bb747e commit 95a518b
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,6 @@ BEGIN
END
GO

-- DNN-4288: make sure, portalId has to be specified, when adding non-system rows:
IF EXISTS (SELECT * FROM Sys.Check_Constraints WHERE parent_object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}Roles]') AND name = N'CK_{objectQualifier}Roles_PortalId')
ALTER TABLE {databaseOwner}[{objectQualifier}Roles] DROP CONSTRAINT CK_{objectQualifier}Roles_PortalId
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Roles] WITH NOCHECK ADD CONSTRAINT [CK_{objectQualifier}Roles_PortalId] CHECK (PortalId is not null)
GO

-- DNN-4289: optimize roles indexes
IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}Roles]') AND name = N'IX_{objectQualifier}Roles_RoleGroup')
DROP INDEX [IX_{objectQualifier}Roles_RoleGroup] ON {databaseOwner}[{objectQualifier}Roles]
Expand Down

0 comments on commit 95a518b

Please sign in to comment.