1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05:00

SM-1010: Turn off secrets manager beta with a new migration (#3451)

This commit is contained in:
Colton Hurst 2023-11-20 12:36:02 -05:00 committed by GitHub
parent 80740aa4ba
commit 04253d9bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,16 @@
IF COL_LENGTH('[dbo].[Organization]', 'SecretsManagerBeta') IS NOT NULL
BEGIN
-- Set AccessSecretsManager to 0 for Organization Users in SM Beta orgs
UPDATE [dbo].[OrganizationUser]
SET AccessSecretsManager = 0
FROM [dbo].[OrganizationUser] AS ou
INNER JOIN [dbo].[Organization] AS o ON ou.OrganizationId = o.Id
WHERE o.SecretsManagerBeta = 1 AND ou.AccessSecretsManager = 1
-- Set UseSecretsManager and SecretsManagerBeta to 0 for Organizations in SM Beta
UPDATE [dbo].[Organization]
SET UseSecretsManager = 0, SecretsManagerBeta = 0
FROM [dbo].[Organization] AS o
WHERE o.SecretsManagerBeta = 1
END
GO