mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
Update SQL files to be backwards compatible when adding columns (#1635)
* Update SQL files to be backwards compatible when adding columns * Remove 'UseResetPasswordCustomOrg' SQL script
This commit is contained in:
parent
4d6b0c9106
commit
15eeb9d650
@ -11,6 +11,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[UsersGetPremium] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
[UsersGetPremium] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[UsersGetPremium] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
UPDATE
|
UPDATE
|
||||||
|
@ -11,6 +11,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[UseEvents] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
[UseEvents] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[UseEvents] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -11,6 +11,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[Use2fa] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
[Use2fa] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[Use2fa] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -50,6 +50,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[UseApi] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
[UseApi] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[UseApi] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
@ -71,6 +73,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[ApiKey] = (SELECT [dbo].[SecureRandomString]())
|
[ApiKey] = (SELECT [dbo].[SecureRandomString]())
|
||||||
|
WHERE
|
||||||
|
[ApiKey] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -294,6 +294,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[UsePolicies] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
[UsePolicies] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[UsePolicies] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -69,6 +69,8 @@ UPDATE
|
|||||||
[dbo].[CollectionGroup]
|
[dbo].[CollectionGroup]
|
||||||
SET
|
SET
|
||||||
[HidePasswords] = 0
|
[HidePasswords] = 0
|
||||||
|
WHERE
|
||||||
|
[HidePasswords] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
@ -90,6 +92,8 @@ UPDATE
|
|||||||
[dbo].[CollectionUser]
|
[dbo].[CollectionUser]
|
||||||
SET
|
SET
|
||||||
[HidePasswords] = 0
|
[HidePasswords] = 0
|
||||||
|
WHERE
|
||||||
|
[HidePasswords] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -11,6 +11,8 @@ UPDATE
|
|||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
SET
|
SET
|
||||||
[UseSso] = (CASE WHEN [PlanType] = 10 OR [PlanType] = 11 THEN 1 ELSE 0 END)
|
[UseSso] = (CASE WHEN [PlanType] = 10 OR [PlanType] = 11 THEN 1 ELSE 0 END)
|
||||||
|
WHERE
|
||||||
|
[UseSso] IS NULL
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
-- For Enterprise (annual/monthly) and Custom (internal) orgs, enable potential use of UseResetPassword
|
|
||||||
UPDATE
|
|
||||||
[dbo].[Organization]
|
|
||||||
SET
|
|
||||||
[UseResetPassword] = (CASE WHEN [PlanType] IN (10, 11, 6) THEN 1 ELSE [UseResetPassword] END)
|
|
||||||
GO
|
|
Loading…
x
Reference in New Issue
Block a user