Skip to content

Commit 2d90ac6

Browse files
committed
TD-3623-Added migration script to update EnrollmentMethodID in progress table, table join updated in SQL query.
1 parent 710aee5 commit 2d90ac6

File tree

6 files changed

+95
-21
lines changed

6 files changed

+95
-21
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202402271112)]
6+
public class Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_3623_Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Up);
11+
12+
Execute.Sql(
13+
@$"UPDATE Progress SET EnrollmentMethodID = 4
14+
WHERE EnrollmentMethodID = 0 OR EnrollmentMethodID > 4;"
15+
);
16+
}
17+
public override void Down()
18+
{
19+
Execute.Sql(Properties.Resources.TD_3623_Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Down);
20+
}
21+
}
22+
}

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

Lines changed: 65 additions & 19 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,10 @@
364364
<data name="TD_3664_RestoreDroppedSPs" type="System.Resources.ResXFileRef, System.Windows.Forms">
365365
<value>..\Scripts\TD-3664-RestoreDroppedSPs.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
366366
</data>
367-
</root>
367+
<data name="TD_3623_Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
368+
<value>..\Scripts\TD-3623-Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
369+
</data>
370+
<data name="TD_3623_Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
371+
<value>..\Scripts\TD-3623-Alter_uspCreateProgressRecordWithCompleteWithinMonthsSPs_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
372+
</data>
373+
</root>

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ ap.ArchivedDate AS CourseArchivedDate
317317
FROM Customisations cu
318318
INNER JOIN Applications AS ap ON ap.ApplicationID = cu.ApplicationID
319319
INNER JOIN Progress AS pr ON pr.CustomisationID = cu.CustomisationID
320-
INNER JOIN aspProgress AS apr ON pr.ProgressID = apr.ProgressID
320+
LEFT OUTER JOIN aspProgress AS apr ON pr.ProgressID = apr.ProgressID
321321
LEFT OUTER JOIN AdminAccounts AS aaSupervisor ON aaSupervisor.ID = pr.SupervisorAdminId
322322
LEFT OUTER JOIN Users AS uSupervisor ON uSupervisor.ID = aaSupervisor.UserID
323323
LEFT OUTER JOIN AdminAccounts AS aaEnrolledBy ON aaEnrolledBy.ID = pr.EnrolledByAdminID

0 commit comments

Comments
 (0)