Skip to content

Commit

Permalink
[PM-1974] Update the status of organizations from Pending to Created (#…
Browse files Browse the repository at this point in the history
…2886)

---------

Co-authored-by: Thomas Rittson <[email protected]>
(cherry picked from commit b02d86f)
  • Loading branch information
r-tome authored and eliykat committed Apr 27, 2023
1 parent c00a170 commit ff491ec
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions util/Migrator/DbScripts/2023-04-26_01_FixOrganizationStatus.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Update the [Status] of organizations from Pending (0) to Created (1) if they have at least 1 confirmed user
-- This is to fix an issue where the default value of 0 (Pending) was accidentally written back to the database
-- for existing organizations
UPDATE
[dbo].[Organization]
SET
[Status] = 1 -- Created
WHERE
[Status] = 0 -- Pending
AND [Id] IN (
SELECT DISTINCT
ou.[OrganizationId]
FROM
[dbo].OrganizationUser ou
WHERE
ou.[Status] = 2 -- confirmed
)
GO

0 comments on commit ff491ec

Please sign in to comment.