1
0
mirror of https://github.com/bitwarden/server synced 2026-01-21 11:53:41 +00:00

for. key ciphers to orgs. cleanup ciphers on del

This commit is contained in:
Kyle Spearrin
2017-04-25 11:05:35 -04:00
parent 8ade63fd45
commit 39e7ddb72a
2 changed files with 19 additions and 0 deletions

View File

@@ -4,6 +4,24 @@ AS
BEGIN
SET NOCOUNT ON
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @Id
DECLARE @BatchSize INT = 100
WHILE @BatchSize > 0
BEGIN
BEGIN TRANSACTION Organization_DeleteById_Ciphers
DELETE TOP(@BatchSize)
FROM
[dbo].[Cipher]
WHERE
[OrganizationId] = @Id
SET @BatchSize = @@ROWCOUNT
COMMIT TRANSACTION Organization_DeleteById_Ciphers
END
DELETE
FROM
[dbo].[Organization]