From b25db73e24aabac9fb49ca7d0d73f4a5feea9b12 Mon Sep 17 00:00:00 2001 From: James Gunn Date: Thu, 9 Nov 2023 15:22:25 +0000 Subject: [PATCH 1/2] Add index on TRN column to reporting table --- .../Services/DqtReporting/Migrations/0015_ContactTrnIndex.sql | 1 + .../TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0015_ContactTrnIndex.sql diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0015_ContactTrnIndex.sql b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0015_ContactTrnIndex.sql new file mode 100644 index 000000000..614d434f5 --- /dev/null +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrations/0015_ContactTrnIndex.sql @@ -0,0 +1 @@ +create index ix_contact_trn on contact (dfeta_trn) include (id) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj b/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj index 6c4472233..c4ad4efca 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/TeachingRecordSystem.Core.csproj @@ -21,6 +21,7 @@ + @@ -38,6 +39,7 @@ + From 996fe8c1c09a1592fb9dea5e3ba16070ea2b496e Mon Sep 17 00:00:00 2001 From: James Gunn Date: Thu, 9 Nov 2023 15:34:25 +0000 Subject: [PATCH 2/2] Increase the execution timeout for applying reporting DB migrations --- .../Dqt/Services/DqtReporting/Migrator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrator.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrator.cs index 6c12cb28f..a5e7c0152 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrator.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Services/DqtReporting/Migrator.cs @@ -22,7 +22,8 @@ public Migrator(string connectionString, ILogger? logger = null) .LogScriptOutput() .WithTransaction() .JournalToSqlTable("dbo", "__SchemaVersions") - .WithScripts(new DqtReportingMigrationsScriptProvider()); + .WithScripts(new DqtReportingMigrationsScriptProvider()) + .WithExecutionTimeout(TimeSpan.FromMinutes(3)); if (logger is not null) {