From d604842cdc31c0c4d87d56a35085c7717efeef95 Mon Sep 17 00:00:00 2001
From: MrKevJoy <60096576+MrKevJoy@users.noreply.github.com>
Date: Mon, 18 Sep 2023 10:27:57 +0100
Subject: [PATCH] Added new columns to account introduced by evergreen update
wave2 2023 update (#824)
---
.../0008_EvergreenMissingColumns.sql | 31 +++++++++++++++++++
.../TeachingRecordSystem.Core.csproj | 2 ++
2 files changed, 33 insertions(+)
create mode 100644 TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0008_EvergreenMissingColumns.sql
diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0008_EvergreenMissingColumns.sql b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0008_EvergreenMissingColumns.sql
new file mode 100644
index 000000000..44abbf6fa
--- /dev/null
+++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0008_EvergreenMissingColumns.sql
@@ -0,0 +1,31 @@
+--adx_createdbyipaddress
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'adx_createdbyipaddress')
+ alter table account add adx_createdbyipaddress nvarchar(100)
+
+--adx_createdbyusername
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'adx_createdbyusername')
+ alter table account add adx_createdbyusername nvarchar(100)
+
+--adx_modifiedbyipaddress
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'adx_modifiedbyipaddress')
+ alter table account add adx_modifiedbyipaddress nvarchar(100)
+
+--adx_modifiedbyusername
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'adx_modifiedbyusername')
+ alter table account add adx_modifiedbyusername nvarchar(100)
+
+--msa_managingpartnerid
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'msa_managingpartnerid')
+ alter table account add msa_managingpartnerid uniqueidentifier
+
+--msa_managingpartnerid_entitytype
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'msa_managingpartnerid_entitytype')
+ alter table account add msa_managingpartnerid_entitytype nvarchar(128)
+
+--msa_managingpartneridname
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'msa_managingpartneridname')
+ alter table account add msa_managingpartneridname nvarchar(160)
+
+--msa_managingpartneridyominame
+if not exists (select 1 from information_schema.columns where table_name = 'account' and column_name = 'msa_managingpartneridyominame')
+ alter table account add msa_managingpartneridyominame nvarchar(160)
diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj b/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj
index aad62eda4..e69f6bd74 100644
--- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj
+++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj
@@ -14,6 +14,7 @@
+
@@ -24,6 +25,7 @@
+