mirror of
https://github.com/bitwarden/server.git
synced 2025-06-27 14:16:19 -05:00
update security task
This commit is contained in:
parent
1b4c94505a
commit
111f54a6bc
@ -1,4 +1,4 @@
|
|||||||
CREATE PROCEDURE [dbo].[SecurityTask_ReadByUserIdStatus]
|
CREATE OR ALTER PROCEDURE [dbo].[SecurityTask_ReadByUserIdStatus]
|
||||||
@UserId UNIQUEIDENTIFIER,
|
@UserId UNIQUEIDENTIFIER,
|
||||||
@Status TINYINT = NULL
|
@Status TINYINT = NULL
|
||||||
AS
|
AS
|
||||||
@ -62,7 +62,7 @@ BEGIN
|
|||||||
SELECT
|
SELECT
|
||||||
ST.*
|
ST.*
|
||||||
FROM
|
FROM
|
||||||
dbo.[SecurityTaskView] ST
|
dbo.SecurityTask ST
|
||||||
WHERE
|
WHERE
|
||||||
@Status IS NULL
|
@Status IS NULL
|
||||||
OR ST.Status = @Status
|
OR ST.Status = @Status
|
||||||
@ -87,3 +87,43 @@ BEGIN
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
ST.CreationDate DESC;
|
ST.CreationDate DESC;
|
||||||
END
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM sys.indexes
|
||||||
|
WHERE object_id = OBJECT_ID('dbo.CollectionGroup')
|
||||||
|
AND name = 'IX_CollectionGroup_GroupId_ReadOnly'
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
CREATE NONCLUSTERED INDEX IX_CollectionGroup_GroupId_ReadOnly
|
||||||
|
ON dbo.CollectionGroup (GroupId, ReadOnly)
|
||||||
|
INCLUDE (CollectionId);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM sys.indexes
|
||||||
|
WHERE object_id = OBJECT_ID('dbo.CollectionUser')
|
||||||
|
AND name = 'IX_CollectionUser_OrganizationUserId_ReadOnly'
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
CREATE NONCLUSTERED INDEX IX_CollectionUser_OrganizationUserId_ReadOnly
|
||||||
|
ON dbo.CollectionUser (OrganizationUserId, ReadOnly)
|
||||||
|
INCLUDE (CollectionId);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM sys.indexes
|
||||||
|
WHERE object_id = OBJECT_ID('dbo.SecurityTask')
|
||||||
|
AND name = 'IX_SecurityTask_Status_OrgId_CreationDateDesc'
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
CREATE NONCLUSTERED INDEX IX_SecurityTask_Status_OrgId_CreationDateDesc
|
||||||
|
ON dbo.SecurityTask (Status, OrganizationId, CreationDate DESC)
|
||||||
|
INCLUDE (CipherId, [Type], RevisionDate);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user