mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
f235938c41
* Fix OrgUserDelete sprocs * Update Sqlproj
48 lines
1.1 KiB
Transact-SQL
48 lines
1.1 KiB
Transact-SQL
-- OrganizationSponsorship_OrganizationUserDeleted
|
|
IF OBJECT_ID('[dbo].[OrganizationSponsorship_OrganizationUserDeleted]') IS NOT NULL
|
|
BEGIN
|
|
DROP PROCEDURE [dbo].[OrganizationSponsorship_OrganizationUserDeleted]
|
|
END
|
|
GO
|
|
|
|
CREATE PROCEDURE [dbo].[OrganizationSponsorship_OrganizationUserDeleted]
|
|
@OrganizationUserId UNIQUEIDENTIFIER
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
UPDATE
|
|
OS
|
|
SET
|
|
[ToDelete] = 1
|
|
FROM
|
|
[dbo].[OrganizationSponsorship] OS
|
|
WHERE
|
|
[SponsoringOrganizationUserId] = @OrganizationUserId
|
|
END
|
|
GO
|
|
|
|
-- OrganizationSponsorship_OrganizationUsersDeleted
|
|
IF OBJECT_ID('[dbo].[OrganizationSponsorship_OrganizationUsersDeleted]') IS NOT NULL
|
|
BEGIN
|
|
DROP PROCEDURE [dbo].[OrganizationSponsorship_OrganizationUsersDeleted]
|
|
END
|
|
GO
|
|
|
|
CREATE PROCEDURE [dbo].[OrganizationSponsorship_OrganizationUsersDeleted]
|
|
@SponsoringOrganizationUserIds [dbo].[GuidIdArray] READONLY
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
UPDATE
|
|
OS
|
|
SET
|
|
[ToDelete] = 1
|
|
FROM
|
|
[dbo].[OrganizationSponsorship] OS
|
|
INNER JOIN
|
|
@SponsoringOrganizationUserIds I ON I.Id = OS.SponsoringOrganizationUserId
|
|
END
|
|
GO
|