1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

collection cipher query improvements

This commit is contained in:
Kyle Spearrin
2019-05-28 23:55:35 -04:00
parent 3feaaf8f01
commit 35804e10cf
3 changed files with 163 additions and 2 deletions

View File

@ -42,9 +42,18 @@ BEGIN
OR G.[AccessAll] = 1
OR CG.[ReadOnly] = 0
)
),
[CollectionCiphersCTE] AS(
SELECT
[CollectionId],
[CipherId]
FROM
[dbo].[CollectionCipher]
WHERE
[CipherId] = @CipherId
)
MERGE
[dbo].[CollectionCipher] AS [Target]
[CollectionCiphersCTE] AS [Target]
USING
@CollectionIds AS [Source]
ON

View File

@ -13,9 +13,18 @@ BEGIN
[dbo].[Collection]
WHERE
OrganizationId = @OrganizationId
),
[CollectionCiphersCTE] AS(
SELECT
[CollectionId],
[CipherId]
FROM
[dbo].[CollectionCipher]
WHERE
[CipherId] = @CipherId
)
MERGE
[dbo].[CollectionCipher] AS [Target]
[CollectionCiphersCTE] AS [Target]
USING
@CollectionIds AS [Source]
ON