1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

get cipher by org id index

This commit is contained in:
Kyle Spearrin 2018-05-11 08:31:29 -04:00
parent 053096c1a1
commit f5c9672370
2 changed files with 15 additions and 0 deletions

View File

@ -20,3 +20,8 @@ CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_OrganizationId_IncludeAll]
ON [dbo].[Cipher]([UserId] ASC, [OrganizationId] ASC) ON [dbo].[Cipher]([UserId] ASC, [OrganizationId] ASC)
INCLUDE ([Type], [Data], [Favorites], [Folders], [Attachments], [CreationDate], [RevisionDate]); INCLUDE ([Type], [Data], [Favorites], [Folders], [Attachments], [CreationDate], [RevisionDate]);
GO
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId]
ON [dbo].[Cipher]([OrganizationId] ASC);

View File

@ -134,6 +134,16 @@ BEGIN
END END
GO GO
IF NOT EXISTS (
SELECT * FROM sys.indexes WHERE [Name]='IX_Cipher_OrganizationId'
AND object_id = OBJECT_ID('[dbo].[Cipher]')
)
BEGIN
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId]
ON [dbo].[Cipher]([OrganizationId] ASC)
END
GO
IF NOT EXISTS ( IF NOT EXISTS (
SELECT * FROM sys.indexes WHERE [Name]='IX_GroupUser_OrganizationUserId' SELECT * FROM sys.indexes WHERE [Name]='IX_GroupUser_OrganizationUserId'
AND object_id = OBJECT_ID('[dbo].[GroupUser]') AND object_id = OBJECT_ID('[dbo].[GroupUser]')