1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-29 13:25:17 +01:00

sproc fixes

This commit is contained in:
Kyle Spearrin 2017-05-20 08:53:24 -04:00
parent f194551afc
commit 6dac704708
3 changed files with 19 additions and 3 deletions

View File

@ -4,7 +4,7 @@
@Name VARCHAR(MAX), @Name VARCHAR(MAX),
@CreationDate DATETIME2(7), @CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7), @RevisionDate DATETIME2(7),
@GroupIds AS [dbo].[GuidIdArray] READONLY @Groups AS [dbo].[SelectionReadOnlyArray] READONLY
AS AS
BEGIN BEGIN
SET NOCOUNT ON SET NOCOUNT ON
@ -28,9 +28,9 @@ BEGIN
SELECT SELECT
@Id, @Id,
[Id], [Id],
0 [ReadOnly]
FROM FROM
@GroupIds @Groups
WHERE WHERE
[Id] IN (SELECT [Id] FROM [AvailableGroupsCTE]) [Id] IN (SELECT [Id] FROM [AvailableGroupsCTE])
END END

View File

@ -4,6 +4,12 @@ AS
BEGIN BEGIN
SET NOCOUNT ON SET NOCOUNT ON
DELETE
FROM
[dbo].[CollectionGroup]
WHERE
[CollectionId] = @Id
DELETE DELETE
FROM FROM
[dbo].[Collection] [dbo].[Collection]

View File

@ -48,6 +48,16 @@ BEGIN
WHERE WHERE
OU.[UserId] = @Id OU.[UserId] = @Id
-- Delete group users
DELETE
GU
FROM
[dbo].[GroupUser] GU
INNER JOIN
[dbo].[OrganizationUser] OU ON OU.[Id] = GU.[OrganizationUserId]
WHERE
OU.[UserId] = @Id
-- Delete organization users -- Delete organization users
DELETE DELETE
FROM FROM