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

Migration to backfill LMSCourse.lms_api_course_id from existing grouping rows #6945

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Jan 8, 2025

For:

While this data was in the database as part of Grouping.extra we "promoted" it to its own column on LMSCourse to make it easier to query and index.

While we only have this now for canvas now the new column names is a generic one now

See: #6944

Testing

  • Launch a couple of assignment from different courses

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

in make sql

update lms_course set lms_api_course_id = null;

UPDATE 2
  • Run the migration to backfill the values back:

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

  • Check the values have been indeed set again:

in make sql:

select name, lms_api_course_id from lms_course where lms_api_course_id is not null;


                    name                     | lms_api_course_id 
---------------------------------------------+-------------------
 LTI 1.3 Testing                             | 319
 Developer Test Course with Sections Enabled | 125
(2 rows)

@marcospri marcospri force-pushed the api-course-id-backfill branch from ced4d6e to 1c4cd93 Compare January 8, 2025 14:06
@marcospri marcospri changed the title Migration to fill LMSCourse.lms_api_course_id from existing grouping rows Migration to backfill LMSCourse.lms_api_course_id from existing grouping rows Jan 8, 2025
@marcospri marcospri requested a review from mtomilov January 8, 2025 15:10
@marcospri marcospri marked this pull request as ready for review January 8, 2025 15:10
Copy link

@mtomilov mtomilov left a comment

Choose a reason for hiding this comment

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

Looks good

mtomilov
mtomilov approved these changes Jan 10, 2025
Base automatically changed from api-course-id-code to main January 13, 2025 09:26
…rows

While this data was in the database as part of Grouping.extra we "promoted"
it to it's own column on LMSCourse to make it easier to query and index.

While we only have this now for canvas now the new column names is a generic one now
@marcospri marcospri force-pushed the api-course-id-backfill branch from 1c4cd93 to b2623b9 Compare January 13, 2025 09:45
@marcospri marcospri merged commit 7647bf4 into main Jan 13, 2025
9 checks passed
@marcospri marcospri deleted the api-course-id-backfill branch January 13, 2025 09:48
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