Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1928: Student absence from enrollments #1969

Merged
merged 15 commits into from
Aug 21, 2024
Merged

Conversation

KralMarko123
Copy link
Contributor

@KralMarko123 KralMarko123 commented Jul 22, 2024

Feat for #1928

  • Updated student lesson summaries view to include enrollments and check if lesson date was in range for a student
  • Modified enrollments trigger to update existing rows correctly and insert a new row when students are updated
  • Update Lesson table row and Group lesson summary views according to changes above
  • Added Enrollment tests and fixed failing ones

if current_enrollment_group_id is null then
insert into enrollments (student_id, group_id, active_since, inactive_since, created_at, updated_at)
values (new.id, new.group_id, now(), null, now(), now());
else if current_enrollment_group_id != new.group_id then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you're doing here is nesting the if inside the else branch so you need 2 end if statements at the end.

This works but we can clean it up by using elsif which is the plpgsql way to do this

@tomca32 tomca32 merged commit 254a3b5 into master Aug 21, 2024
4 checks passed
@tomca32 tomca32 deleted the 1928/enrollment-absence branch August 21, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants