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

Open
wants to merge 1 commit into
base: api-course-id-code
Choose a base branch
from

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)

…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 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
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.

1 participant