From d688d7dfd17b935bd2326ad93f84dd7296b7b2d0 Mon Sep 17 00:00:00 2001 From: Tobi Awe Date: Mon, 13 Apr 2026 15:57:01 +0100 Subject: [PATCH 1/2] Resume Change Tracking after each deployment. --- .../LearningHub.Nhs.Database.sqlproj | 1 + .../Post-Deploy/Script.PostDeployment.sql | 1 + .../TD-7106-Resume-Databricks-Ingestion.sql | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7106-Resume-Databricks-Ingestion.sql diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj index 705fc366..f9b533c1 100644 --- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj +++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj @@ -568,6 +568,7 @@ + diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql index 672b5785..acee39c1 100644 --- a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql @@ -87,4 +87,5 @@ UPDATE [resources].[ResourceVersion] SET CertificateEnabled = 0 WHERE VersionSta :r .\Scripts\PPSXFileType.sql :r .\Scripts\UpdateFileTypes.sql :r .\Scripts\TD-7116-mib_new_env.sql +:r .\Script\TD-7106-Resume-Databricks-Ingestion.sql diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7106-Resume-Databricks-Ingestion.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7106-Resume-Databricks-Ingestion.sql new file mode 100644 index 00000000..710a7f89 --- /dev/null +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7106-Resume-Databricks-Ingestion.sql @@ -0,0 +1,17 @@ +IF EXISTS ( + SELECT 1 + FROM sys.change_tracking_databases + WHERE database_id = DB_ID() +) +BEGIN + PRINT 'Change Tracking is enabled. Executing setup...'; + + EXEC dbo.lakeflowSetupChangeTracking + @Tables = 'activity.ResourceActivity', --(to include all other tables with CT enabled) + @User = 'Elfhadmin', + @Retention = '2 DAYS'; +END +ELSE +BEGIN + PRINT 'Change Tracking is NOT enabled on this database. Skipping execution.'; +END \ No newline at end of file From 8c6ff38b16131d8df8ed50e2b17f64f77d136f36 Mon Sep 17 00:00:00 2001 From: Tobi Awe Date: Mon, 13 Apr 2026 17:18:28 +0100 Subject: [PATCH 2/2] . --- .../Scripts/Post-Deploy/Script.PostDeployment.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql index acee39c1..2b2bcda6 100644 --- a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql @@ -87,5 +87,4 @@ UPDATE [resources].[ResourceVersion] SET CertificateEnabled = 0 WHERE VersionSta :r .\Scripts\PPSXFileType.sql :r .\Scripts\UpdateFileTypes.sql :r .\Scripts\TD-7116-mib_new_env.sql -:r .\Script\TD-7106-Resume-Databricks-Ingestion.sql - +:r .\Scripts\TD-7106-Resume-Databricks-Ingestion.sql