Skip to content

Commit 7e308b0

Browse files
authored
Merge pull request #2874 from TechnologyEnhancedLearning/Develop/Fix/TD-4787-NominatedSupervisors-change-role-Assessor
TD-4787-Changed role from Educator/Manager to Assessor for nominated supervisors.
2 parents 1c6b8bd + 1987b1e commit 7e308b0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+

2+
namespace DigitalLearningSolutions.Data.Migrations
3+
{
4+
using FluentMigrator;
5+
6+
[Migration(202410071401)]
7+
public class UpdateCandidateAssessmentSupervisorsTabl : ForwardOnlyMigration
8+
{
9+
public override void Up()
10+
{
11+
Execute.Sql($@"UPDATE cas
12+
SET SelfAssessmentSupervisorRoleID = (SELECT ID FROM SelfAssessmentSupervisorRoles
13+
WHERE SelfAssessmentID = ssr.SelfAssessmentID and AllowDelegateNomination = 1)
14+
FROM CandidateAssessmentSupervisors cas INNER JOIN
15+
SelfAssessmentSupervisorRoles ssr ON cas.SelfAssessmentSupervisorRoleID = ssr.ID
16+
AND cas.Removed IS NULL AND ssr.AllowDelegateNomination = 0 INNER JOIN
17+
SupervisorDelegates sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN
18+
AdminAccounts aa ON sd.SupervisorAdminID = aa.ID WHERE aa.IsSupervisor = 0 AND aa.IsNominatedSupervisor = 1");
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)