Skip to content

Commit 5d0610c

Browse files
authored
Merge pull request #3292 from TechnologyEnhancedLearning/DLS-Release-v1.2.1
Dls release v1.2.1
2 parents 74261da + d7e07a6 commit 5d0610c

File tree

78 files changed

+2228
-1221
lines changed

Some content is hidden

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

78 files changed

+2228
-1221
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202503111500)]
6+
public class AddLastAccessedColumn : Migration
7+
{
8+
public override void Up()
9+
{
10+
Alter.Table("Users").AddColumn("LastAccessed").AsDateTime().Nullable();
11+
Alter.Table("DelegateAccounts").AddColumn("LastAccessed").AsDateTime().Nullable();
12+
Alter.Table("AdminAccounts").AddColumn("LastAccessed").AsDateTime().Nullable();
13+
14+
Execute.Sql("UPDATE u SET LastAccessed = (SELECT MAX(s.LoginTime) FROM DelegateAccounts da JOIN Sessions s ON da.ID = s.CandidateId WHERE da.UserID = u.ID) FROM users u;");
15+
Execute.Sql("UPDATE da SET LastAccessed = (SELECT MAX(s.LoginTime) FROM Sessions s WHERE s.CandidateId = da.ID) FROM DelegateAccounts da;");
16+
Execute.Sql("UPDATE da SET LastAccessed = (SELECT ca.LastAccessed FROM CandidateAssessments ca WHERE ca.ID = da.ID) FROM DelegateAccounts da where da.LastAccessed IS NULL;");
17+
Execute.Sql("UPDATE AA SET LastAccessed = (SELECT MAX(AdS.LoginTime) FROM AdminSessions AdS WHERE AdS.AdminID = AA.ID) FROM AdminAccounts AA;");
18+
}
19+
public override void Down()
20+
{
21+
Delete.Column("LastAccessed").FromTable("Users");
22+
Delete.Column("LastAccessed").FromTable("DelegateAccounts");
23+
Delete.Column("LastAccessed").FromTable("AdminAccounts");
24+
}
25+
}
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+

2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
using FluentMigrator;
6+
7+
[Migration(2025041161520)]
8+
public class Alter_SendExpiredTBCReminders_AppendCourseName : Migration
9+
{
10+
public override void Up()
11+
{
12+
Execute.Sql(Properties.Resources.TD_5514_Alter_SendExpiredTBCReminders_Up);
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(Properties.Resources.TD_5514_Alter_SendExpiredTBCReminders_Down);
17+
}
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+

2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
using FluentMigrator;
6+
7+
[Migration(202504281045)]
8+
public class Alter_ReorderFrameworkCompetency : Migration
9+
{
10+
public override void Up()
11+
{
12+
Execute.Sql(Properties.Resources.TD_5447_Alter_ReorderFrameworkCompetency_Up);
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(Properties.Resources.TD_5447_Alter_ReorderFrameworkCompetency_Down);
17+
}
18+
}
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
[Migration(202504281115)]
5+
public class UpdateFrameworkCompetenciesOrdering : ForwardOnlyMigration
6+
{
7+
public override void Up()
8+
{
9+
Execute.Sql(@"WITH Ranked AS (
10+
    SELECT ID,
11+
            ROW_NUMBER() OVER (PARTITION BY FrameworkID ORDER BY SysStartTime) AS NewOrder
12+
    FROM FrameworkCompetencies
13+
Where FrameworkCompetencyGroupID is null
14+
)
15+
UPDATE fc
16+
SET fc.Ordering = r.NewOrder
17+
FROM FrameworkCompetencies fc
18+
JOIN Ranked r ON fc.ID = r.ID;");
19+
}
20+
}
21+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202504290900)]
6+
public class UpdateNotifications : ForwardOnlyMigration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(@$"UPDATE Notifications SET NotificationName = 'Completed course follow-up feedback requests' where NotificationID = 13");
11+
}
12+
13+
}
14+
}

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,4 +475,16 @@
475475
<data name="TD_5412_Alter_SendExpiredTBCReminders_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
476476
<value>..\Scripts\TD-5412-Alter_SendExpiredTBCReminders_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
477477
</data>
478+
<data name="TD_5514_Alter_SendExpiredTBCReminders_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
479+
<value>..\Scripts\TD-5514-Alter_SendExpiredTBCReminders_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
480+
</data>
481+
<data name="TD_5514_Alter_SendExpiredTBCReminders_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
482+
<value>..\Scripts\TD-5514-Alter_SendExpiredTBCReminders_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
483+
</data>
484+
<data name="TD_5447_Alter_ReorderFrameworkCompetency_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
485+
<value>..\Scripts\TD-5447-Alter_ReorderFrameworkCompetency_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
486+
</data>
487+
<data name="TD_5447_Alter_ReorderFrameworkCompetency_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
488+
<value>..\Scripts\TD-5447-Alter_ReorderFrameworkCompetency_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
489+
</data>
478490
</root>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)