Skip to content

Commit

Permalink
Merge pull request #2874 from TechnologyEnhancedLearning/Develop/Fix/…
Browse files Browse the repository at this point in the history
…TD-4787-NominatedSupervisors-change-role-Assessor

TD-4787-Changed role from Educator/Manager to Assessor for nominated supervisors.
  • Loading branch information
rshrirohit authored Oct 17, 2024
2 parents 1c6b8bd + 1987b1e commit 7e308b0
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

namespace DigitalLearningSolutions.Data.Migrations
{
using FluentMigrator;

[Migration(202410071401)]
public class UpdateCandidateAssessmentSupervisorsTabl : ForwardOnlyMigration
{
public override void Up()
{
Execute.Sql($@"UPDATE cas
SET SelfAssessmentSupervisorRoleID = (SELECT ID FROM SelfAssessmentSupervisorRoles
WHERE SelfAssessmentID = ssr.SelfAssessmentID and AllowDelegateNomination = 1)
FROM CandidateAssessmentSupervisors cas INNER JOIN
SelfAssessmentSupervisorRoles ssr ON cas.SelfAssessmentSupervisorRoleID = ssr.ID
AND cas.Removed IS NULL AND ssr.AllowDelegateNomination = 0 INNER JOIN
SupervisorDelegates sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN
AdminAccounts aa ON sd.SupervisorAdminID = aa.ID WHERE aa.IsSupervisor = 0 AND aa.IsNominatedSupervisor = 1");
}
}
}

0 comments on commit 7e308b0

Please sign in to comment.