Skip to content

Commit b9f5495

Browse files
authored
Merge pull request #2473 from TechnologyEnhancedLearning/Release-DLS-2023.23
Merge Release DLS 2023.23 into Master
2 parents be5188b + 3f6934e commit b9f5495

File tree

530 files changed

+12967
-2847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+12967
-2847
lines changed

.gitguardian.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
secret:
2+
ignored-matches:
3+
- match: 2cd876d916d5d06984da35b99466857b4e9b19ab643b0e2eb15d4faf29f3ba44
4+
name: Generic High Entropy Secret - DigitalLearningSolutions.Data.Migrations/202310131115_AddFreshdeskApikeyConfigValue.cs
5+
version: 2
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using FluentMigrator;
2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
[Migration(202310021046)]
6+
public class GroupDelegatesDuplicateRecordDelete : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(@$"WITH CTE AS
11+
(
12+
SELECT *,ROW_NUMBER() OVER (PARTITION BY GroupID,DelegateID,convert(date,addedDate) ORDER BY GroupID,DelegateID,convert(date,addedDate)) AS RN
13+
FROM GroupDelegates
14+
)
15+
16+
DELETE FROM CTE WHERE RN>1"
17+
);
18+
}
19+
public override void Down()
20+
{
21+
22+
}
23+
}
24+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace DigitalLearningSolutions.Data.Migrations
8+
{
9+
using FluentMigrator;
10+
[Migration(202310130816)]
11+
public class AddFreshdeskApiUriConfigValue : Migration
12+
{
13+
public override void Up()
14+
{
15+
string freshDeskApiBaseUri = $"https://echobase.freshdesk.com";
16+
Execute.Sql(
17+
@$"IF NOT EXISTS (SELECT ConfigID FROM Config WHERE ConfigName = 'FreshdeskAPIBaseUri')
18+
BEGIN
19+
INSERT INTO Config VALUES ('FreshdeskAPIBaseUri', '{freshDeskApiBaseUri}', 0,GETDATE(), GETDATE())
20+
END"
21+
);
22+
}
23+
24+
public override void Down()
25+
{
26+
Execute.Sql(@"DELETE FROM Config
27+
` WHERE ConfigName = N'FreshdeskAPIBaseUri'");
28+
}
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace DigitalLearningSolutions.Data.Migrations
8+
{
9+
using FluentMigrator;
10+
[Migration(202310130817)]
11+
public class AddFreshdeskApiCreateTicketUriConfigValue : Migration
12+
{
13+
public override void Up()
14+
{
15+
string freshdeskAPICreateTicketUri = $"/api/v2/tickets";
16+
Execute.Sql(
17+
@$"IF NOT EXISTS (SELECT ConfigID FROM Config WHERE ConfigName = 'FreshdeskAPICreateTicketUri')
18+
BEGIN
19+
INSERT INTO Config VALUES ('FreshdeskAPICreateTicketUri', '{freshdeskAPICreateTicketUri}', 0,GETDATE(), GETDATE())
20+
END"
21+
);
22+
}
23+
24+
public override void Down()
25+
{
26+
Execute.Sql(@"DELETE FROM Config
27+
` WHERE ConfigName = N'FreshdeskAPICreateTicketUri'");
28+
}
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace DigitalLearningSolutions.Data.Migrations
8+
{
9+
using FluentMigrator;
10+
[Migration(202310130818)]
11+
public class AddFreshdeskApiKeyConfigValue : Migration
12+
{
13+
public override void Up()
14+
{
15+
string freshdeskAPIKey = "NOKey";
16+
Execute.Sql(
17+
@$"IF NOT EXISTS (SELECT ConfigID FROM Config WHERE ConfigName = 'FreshdeskAPIKey')
18+
BEGIN
19+
INSERT INTO Config VALUES ('FreshdeskAPIKey', '{freshdeskAPIKey}', 0,GETDATE(), GETDATE())
20+
END"
21+
);
22+
}
23+
24+
public override void Down()
25+
{
26+
Execute.Sql(@"DELETE FROM Config
27+
` WHERE ConfigName = N'FreshdeskAPIKey'");
28+
}
29+
}
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
[Migration(202310181537)]
5+
public class AspProgressAddSuspenDataColumn : Migration
6+
{
7+
public override void Up()
8+
{
9+
Alter.Table("aspProgress").AddColumn("SuspendData").AsString(4096).Nullable();
10+
}
11+
public override void Down()
12+
{
13+
Delete.Column("SuspendData").FromTable("aspProgress");
14+
}
15+
}
16+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace DigitalLearningSolutions.Data.Migrations
8+
{
9+
using FluentMigrator;
10+
[Migration(202310191018)]
11+
public class AddNewColumnInTicketTypes : Migration
12+
{
13+
public override void Up()
14+
{
15+
Execute.Sql(
16+
@$"BEGIN
17+
ALTER TABLE [TicketTypes] ADD FreshdeskTicketType nvarchar(50);
18+
END"
19+
);
20+
Execute.Sql(
21+
@$"BEGIN
22+
UPDATE [TicketTypes] SET FreshdeskTicketType = 'Question' WHERE [TicketTypeID] = 1;
23+
UPDATE [TicketTypes] SET FreshdeskTicketType = 'Question' WHERE [TicketTypeID] = 2;
24+
UPDATE [TicketTypes] SET FreshdeskTicketType = 'Feature Request' WHERE [TicketTypeID] = 3;
25+
UPDATE [TicketTypes] SET FreshdeskTicketType = 'Problem' WHERE [TicketTypeID] = 4;
26+
END"
27+
);
28+
}
29+
30+
public override void Down()
31+
{
32+
Execute.Sql(@"ALTER TABLE [TicketTypes] DROP COLUMN FreshdeskTicketType;");
33+
}
34+
}
35+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
[Migration(202311060819)]
5+
public class AspProgressAddLessonLocationColumn : Migration
6+
{
7+
public override void Up()
8+
{
9+
Alter.Table("aspProgress").AddColumn("LessonLocation").AsString(255).Nullable();
10+
}
11+
public override void Down()
12+
{
13+
Delete.Column("LessonLocation").FromTable("aspProgress");
14+
}
15+
}
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202311291230)]
6+
public class CreateSelfAssessmentRemindersSPs : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_3190_SendOneMonthSelfAssessmentTBCRemindersSP);
11+
Execute.Sql(Properties.Resources.TD_3190_SendOneMonthSelfAssessmentOverdueRemindersSP);
12+
}
13+
public override void Down()
14+
{
15+
Execute.Sql("DROP PROCEDURE [dbo].[SendOneMonthSelfAssessmentTBCReminders]");
16+
Execute.Sql("DROP PROCEDURE [dbo].[SendSelfAssessmentOverdueReminders]");
17+
}
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202312061623)]
6+
public class FixSelfAssessmentRemindersSPs : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_3190_FixSelfAssessmentReminderQueriesSP_UP);
11+
}
12+
public override void Down()
13+
{
14+
Execute.Sql(Properties.Resources.TD_3190_SendOneMonthSelfAssessmentTBCRemindersSP);
15+
Execute.Sql(Properties.Resources.TD_3190_SendOneMonthSelfAssessmentOverdueRemindersSP);
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)