From 87fb3f533c0b4f0ad34833c9148611002dc9960b Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Thu, 12 Aug 2021 13:06:02 -0400 Subject: [PATCH] fixed a bad migration change (#1511) --- ...5_00_OrganizationUserReadByMinimumRole.sql | 1 - ...-08-12_00_ReadByMinimumRoleCheckStatus.sql | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql diff --git a/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql b/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql index e5f22420f2..77779ec59a 100644 --- a/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql +++ b/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql @@ -17,6 +17,5 @@ BEGIN [dbo].[OrganizationUserUserDetailsView] WHERE OrganizationId = @OrganizationId - AND Status = 2 AND [Type] <= @MinRole END diff --git a/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql b/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql new file mode 100644 index 0000000000..cc2a70eff0 --- /dev/null +++ b/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql @@ -0,0 +1,22 @@ +IF OBJECT_ID('[dbo].[OrganizationUser_ReadByMinimumRole]') IS NOT NULL +BEGIN + DROP PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole] +END +GO + +CREATE PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole] + @OrganizationId UNIQUEIDENTIFIER, + @MinRole TINYINT +AS +BEGIN + SET NOCOUNT ON + + SELECT + * + FROM + [dbo].[OrganizationUserUserDetailsView] + WHERE + OrganizationId = @OrganizationId + AND Status = 2 + AND [Type] <= @MinRole +END