1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

[AC-1682] Updated data migration scripts to bump the account revision date

This commit is contained in:
Rui Tome
2024-01-10 12:34:36 +00:00
parent fcd2dd380d
commit 8bf17eb198
3 changed files with 122 additions and 29 deletions

View File

@ -29,5 +29,27 @@ SET [AccessAll] = 0
FROM [dbo].[Group] G
INNER JOIN #TempGroup TG ON G.[Id] = TG.[GroupId]
-- Step 5: Drop the temporary table
-- Step 5: Bump the account revision date for each unique OrganizationId in #TempGroup
DECLARE @OrganizationId UNIQUEIDENTIFIER
DECLARE OrgIdCursor CURSOR FOR
SELECT DISTINCT [OrganizationId]
FROM #TempGroup
OPEN OrgIdCursor
FETCH NEXT FROM OrgIdCursor INTO @OrganizationId
WHILE (@@FETCH_STATUS = 0)
BEGIN
-- Execute the stored procedure for the current OrganizationId
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId
-- Fetch the next OrganizationId
FETCH NEXT FROM OrgIdCursor INTO @OrganizationId
END
CLOSE OrgIdCursor
DEALLOCATE OrgIdCursor;
-- Step 6: Drop the temporary table
DROP TABLE #TempGroup;