mirror of
https://github.com/bitwarden/server.git
synced 2025-07-16 15:17:33 -05:00
Delete OrgUsers When Deleting An Org (#964)
* deleted orgUsers when deleting an org * sql formatting
This commit is contained in:
@ -37,6 +37,20 @@ BEGIN
|
||||
WHERE
|
||||
[OrganizationId] = @Id
|
||||
|
||||
DELETE CU
|
||||
FROM
|
||||
[dbo].[CollectionUser] CU
|
||||
INNER JOIN
|
||||
[dbo].[OrganizationUser] OU ON [CU].[OrganizationUserId] = [OU].[Id]
|
||||
WHERE
|
||||
[OU].[OrganizationId] = @Id
|
||||
|
||||
DELETE
|
||||
FROM
|
||||
[dbo].[OrganizationUser]
|
||||
WHERE
|
||||
[OrganizationId] = @Id
|
||||
|
||||
DELETE
|
||||
FROM
|
||||
[dbo].[Organization]
|
||||
@ -44,4 +58,4 @@ BEGIN
|
||||
[Id] = @Id
|
||||
|
||||
COMMIT TRANSACTION Organization_DeleteById
|
||||
END
|
||||
END
|
||||
|
Reference in New Issue
Block a user