1
0
mirror of https://github.com/bitwarden/server synced 2025-12-26 13:13:24 +00:00

update UserCipherDetails TVF and migration file

This commit is contained in:
jaasen-livefront
2025-11-17 18:40:40 -08:00
parent 9813cb19c8
commit 6a09715158
2 changed files with 12 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ SELECT
C.Favorite,
C.FolderId,
C.DeletedDate,
C.ArchivedDate,
CA.ArchivedDate,
C.Reprompt,
C.[Key],
CASE
@@ -62,6 +62,8 @@ LEFT JOIN
[dbo].[Group] G ON G.[Id] = GU.[GroupId]
LEFT JOIN
[dbo].[CollectionGroup] CG ON CG.[CollectionId] = CC.[CollectionId] AND CG.[GroupId] = GU.[GroupId]
LEFT JOIN
[dbo].[CipherArchive] CA ON CA.[CipherId] = C.[Id] AND CA.[UserId] = @UserId
WHERE
CU.[CollectionId] IS NOT NULL
OR CG.[CollectionId] IS NOT NULL
@@ -80,7 +82,7 @@ SELECT
C.Favorite,
C.FolderId,
C.DeletedDate,
C.ArchivedDate,
CA.ArchivedDate,
C.Reprompt,
C.[Key],
1 [Edit],
@@ -89,5 +91,7 @@ SELECT
0 [OrganizationUseTotp]
FROM
[dbo].[CipherDetails](@UserId) AS C
LEFT JOIN
[dbo].[CipherArchive] CA ON CA.[CipherId] = C.[Id] AND CA.[UserId] = @UserId
WHERE
C.[UserId] = @UserId;

View File

@@ -194,7 +194,7 @@ SELECT
C.Favorite,
C.FolderId,
C.DeletedDate,
C.ArchivedDate,
CA.ArchivedDate,
C.Reprompt,
C.[Key],
CASE
@@ -233,6 +233,8 @@ LEFT JOIN
[dbo].[Group] G ON G.[Id] = GU.[GroupId]
LEFT JOIN
[dbo].[CollectionGroup] CG ON CG.[CollectionId] = CC.[CollectionId] AND CG.[GroupId] = GU.[GroupId]
LEFT JOIN
[dbo].[CipherArchive] CA ON CA.[CipherId] = C.[Id] AND CA.[UserId] = @UserId
WHERE
CU.[CollectionId] IS NOT NULL
OR CG.[CollectionId] IS NOT NULL
@@ -251,7 +253,7 @@ SELECT
C.Favorite,
C.FolderId,
C.DeletedDate,
C.ArchivedDate,
CA.ArchivedDate,
C.Reprompt,
C.[Key],
1 [Edit],
@@ -260,6 +262,7 @@ SELECT
0 [OrganizationUseTotp]
FROM
[dbo].[CipherDetails](@UserId) AS C
LEFT JOIN
[dbo].[CipherArchive] CA ON CA.[CipherId] = C.[Id] AND CA.[UserId] = @UserId
WHERE
C.[UserId] = @UserId;
GO