1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

[PM-19195] Remove deprecated stored procedures (#6128)

This commit is contained in:
Rui Tomé
2025-07-29 14:22:09 +01:00
committed by GitHub
parent 3f508cd43b
commit 52ef3ef7a5
3 changed files with 11 additions and 62 deletions

View File

@@ -1,29 +0,0 @@
CREATE PROCEDURE [dbo].[OrganizationUser_SetStatusForUsersById]
@OrganizationUserIds AS NVARCHAR(MAX),
@Status SMALLINT
AS
BEGIN
SET NOCOUNT ON
-- Declare a table variable to hold the parsed JSON data
DECLARE @ParsedIds TABLE (Id UNIQUEIDENTIFIER);
-- Parse the JSON input into the table variable
INSERT INTO @ParsedIds (Id)
SELECT value
FROM OPENJSON(@OrganizationUserIds);
-- Check if the input table is empty
IF (SELECT COUNT(1) FROM @ParsedIds) < 1
BEGIN
RETURN(-1);
END
UPDATE
[dbo].[OrganizationUser]
SET [Status] = @Status
WHERE [Id] IN (SELECT Id from @ParsedIds)
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationUserIdsJson] @OrganizationUserIds
END

View File

@@ -1,33 +0,0 @@
CREATE PROCEDURE [dbo].[User_BumpAccountRevisionDateByOrganizationUserIdsJson]
@OrganizationUserIds NVARCHAR(MAX)
AS
BEGIN
SET NOCOUNT ON
CREATE TABLE #UserIds
(
UserId UNIQUEIDENTIFIER NOT NULL
);
INSERT INTO #UserIds (UserId)
SELECT
OU.UserId
FROM
[dbo].[OrganizationUser] OU
INNER JOIN
(SELECT [value] as Id FROM OPENJSON(@OrganizationUserIds)) AS OUIds
ON OUIds.Id = OU.Id
WHERE
OU.[Status] = 2 -- Confirmed
UPDATE
U
SET
U.[AccountRevisionDate] = GETUTCDATE()
FROM
[dbo].[User] U
INNER JOIN
#UserIds ON U.[Id] = #UserIds.[UserId]
DROP TABLE #UserIds
END

View File

@@ -0,0 +1,11 @@
IF OBJECT_ID('[dbo].[OrganizationUser_SetStatusForUsersById]') IS NOT NULL
BEGIN
DROP PROCEDURE [dbo].[OrganizationUser_SetStatusForUsersById]
END
GO
IF OBJECT_ID('[dbo].[User_BumpAccountRevisionDateByOrganizationUserIdsJson]') IS NOT NULL
BEGIN
DROP PROCEDURE [dbo].[User_BumpAccountRevisionDateByOrganizationUserIdsJson]
END
GO