diff --git a/util/Migrator/DbScripts/2017-11-06_00_FamilyPlanAdjustments.sql b/util/Migrator/DbScripts/2017-11-06_00_FamilyPlanAdjustments.sql index c22c409777..bbd8b0c785 100644 --- a/util/Migrator/DbScripts/2017-11-06_00_FamilyPlanAdjustments.sql +++ b/util/Migrator/DbScripts/2017-11-06_00_FamilyPlanAdjustments.sql @@ -11,6 +11,8 @@ UPDATE [dbo].[Organization] SET [UsersGetPremium] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END) +WHERE + [UsersGetPremium] IS NULL GO UPDATE diff --git a/util/Migrator/DbScripts/2017-12-12_00_Events.sql b/util/Migrator/DbScripts/2017-12-12_00_Events.sql index e92dda9c94..06ac9e8bb8 100644 --- a/util/Migrator/DbScripts/2017-12-12_00_Events.sql +++ b/util/Migrator/DbScripts/2017-12-12_00_Events.sql @@ -11,6 +11,8 @@ UPDATE [dbo].[Organization] SET [UseEvents] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END) +WHERE + [UseEvents] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2018-04-02_00_Org2fa.sql b/util/Migrator/DbScripts/2018-04-02_00_Org2fa.sql index 7b9ac7e5e7..87421f2a79 100644 --- a/util/Migrator/DbScripts/2018-04-02_00_Org2fa.sql +++ b/util/Migrator/DbScripts/2018-04-02_00_Org2fa.sql @@ -11,6 +11,8 @@ UPDATE [dbo].[Organization] SET [Use2fa] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END) +WHERE + [Use2fa] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2019-03-01_00_OrgApi.sql b/util/Migrator/DbScripts/2019-03-01_00_OrgApi.sql index 83d41b3e4b..5deb092f0a 100644 --- a/util/Migrator/DbScripts/2019-03-01_00_OrgApi.sql +++ b/util/Migrator/DbScripts/2019-03-01_00_OrgApi.sql @@ -50,6 +50,8 @@ UPDATE [dbo].[Organization] SET [UseApi] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END) +WHERE + [UseApi] IS NULL GO ALTER TABLE @@ -71,6 +73,8 @@ UPDATE [dbo].[Organization] SET [ApiKey] = (SELECT [dbo].[SecureRandomString]()) +WHERE + [ApiKey] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2020-02-18_00_PolicySetup.sql b/util/Migrator/DbScripts/2020-02-18_00_PolicySetup.sql index db6812e4a8..545b339cc0 100644 --- a/util/Migrator/DbScripts/2020-02-18_00_PolicySetup.sql +++ b/util/Migrator/DbScripts/2020-02-18_00_PolicySetup.sql @@ -294,6 +294,8 @@ UPDATE [dbo].[Organization] SET [UsePolicies] = (CASE WHEN [PlanType] = 5 OR [PlanType] = 4 THEN 1 ELSE 0 END) +WHERE + [UsePolicies] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql b/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql index 39c9366277..1d44b7917b 100644 --- a/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql +++ b/util/Migrator/DbScripts/2020-05-22_00_HiddenPassword.sql @@ -69,6 +69,8 @@ UPDATE [dbo].[CollectionGroup] SET [HidePasswords] = 0 +WHERE + [HidePasswords] IS NULL GO ALTER TABLE @@ -90,6 +92,8 @@ UPDATE [dbo].[CollectionUser] SET [HidePasswords] = 0 +WHERE + [HidePasswords] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2020-07-20_00_OrgSso.sql b/util/Migrator/DbScripts/2020-07-20_00_OrgSso.sql index 406b49504c..e61945b6ce 100644 --- a/util/Migrator/DbScripts/2020-07-20_00_OrgSso.sql +++ b/util/Migrator/DbScripts/2020-07-20_00_OrgSso.sql @@ -11,6 +11,8 @@ UPDATE [dbo].[Organization] SET [UseSso] = (CASE WHEN [PlanType] = 10 OR [PlanType] = 11 THEN 1 ELSE 0 END) +WHERE + [UseSso] IS NULL GO ALTER TABLE diff --git a/util/Migrator/DbScripts/2021-06-15_00_UseResetPasswordCustomOrg.sql b/util/Migrator/DbScripts/2021-06-15_00_UseResetPasswordCustomOrg.sql deleted file mode 100644 index b9b4e5b45d..0000000000 --- a/util/Migrator/DbScripts/2021-06-15_00_UseResetPasswordCustomOrg.sql +++ /dev/null @@ -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 \ No newline at end of file