1
0
mirror of https://github.com/bitwarden/server synced 2026-01-09 20:13:24 +00:00

query fixes for folders. denormalize userid

This commit is contained in:
Kyle Spearrin
2017-04-14 09:47:35 -04:00
parent 63e95f0f55
commit 943ef81c06
7 changed files with 24 additions and 25 deletions

View File

@@ -25,7 +25,8 @@ GO
CREATE TABLE [dbo].[FolderCipher] (
[FolderId] UNIQUEIDENTIFIER NOT NULL,
[CipherId] UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT [PK_FolderCipher] PRIMARY KEY CLUSTERED ([FolderId] ASC, [CipherId] ASC)
[UserId] UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT [PK_FolderCipher] PRIMARY KEY CLUSTERED ([UserId] ASC, [FolderId] ASC, [CipherId] ASC)
)
GO

View File

@@ -6,7 +6,7 @@ from cipher
where [type] = 0
insert into foldercipher
select FolderId, Id
select FolderId, Id, UserId
from cipher
where [FolderId] is not null