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

Backfill LMSCourseMembership #6856

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Nov 15, 2024

For:

We never stored course level membership information with roles. We only did that at the assignment level.

Use the assignment level information to fill the parent course membership information.

Testing

  • Truncate the target and source tables:
truncate assignment_membership, lms_course_membership cascade;
  • Launch a bunch of assignments

https://hypothesis.instructure.com/courses/125/assignments/1833
https://hypothesis.instructure.com/courses/125/assignments/874
https://hypothesis.instructure.com/courses/319/assignments/3308

  • Check the state of the table now:
 select lms_course_id, lms_user_id, lti_role_id from  lms_course_membership;
 lms_course_id | lms_user_id | lti_role_id
---------------+-------------+-------------
           104 |         982 |          17
           104 |         982 |          18
           104 |         982 |          20
           104 |         982 |          19
           105 |         982 |          21
(5 rows)
  • Truncate just the target again:
truncate lms_course_membership cascade;
  • Apply the migration

tox -e dev --run-command 'alembic upgrade head'

  • Check the data again now:
select lms_course_id, lms_user_id, lti_role_id from  lms_course_membership;
 lms_course_id | lms_user_id | lti_role_id
---------------+-------------+-------------
           104 |         982 |          17
           104 |         982 |          19
           104 |         982 |          20
           104 |         982 |          18
           105 |         982 |          21
(5 rows)

which matches the data from before the last truncate.

@marcospri marcospri mentioned this pull request Nov 15, 2024
21 tasks
@marcospri marcospri marked this pull request as ready for review November 15, 2024 11:14
@marcospri marcospri requested a review from acelaya November 15, 2024 11:14
@marcospri marcospri merged commit fa2c3e9 into main Nov 18, 2024
9 checks passed
@marcospri marcospri deleted the lms-course-membership-backfill branch November 18, 2024 08:14
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.

2 participants