Copy course_id into course_key and remove temporary transition code - #138
Merged
Conversation
The migration copies content of the Answer.course_id column into the new extended Answer.course_key column. It skips Answer records that already have the course_key column set.
Previous migration populates any null course_key fields, so we can now change the column to not allow NULL values. We make the deprecated course_id nullable, to be able to start ignoring it later.
Now that all data has been migrated to the new course_key column, we can remove the temporary transition code.
mtyaka
force-pushed
the
mtyaka/copy-course-keys-migration
branch
from
January 13, 2017 07:29
0b5554c to
c733391
Compare
2 tasks
|
Looks good @mtyaka. :) 👍
|
Member
Author
|
@edx/devops Can somebody please review this follow-up to the hotfix we did for problem-builder. It removes the temporary transition code and includes a migration that copies values from the deprecated column into the new, extended /cc @adampalay |
|
code looks ok to me! But this should definitely get ops approval :) |
maxrothman
approved these changes
Jan 24, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #131. In #131, we deprecated the
Answer.course_idfield and replaced it with a newAnswer.course_keyfield with extended length to accommodate courses with course keys longer than 50 characters (for example some CCX courses on edx.org have course keys longer than 50 characters).This PR includes a migration that copies contents of
course_idcolumn intocourse_key, for anyAnswerobject wherecourse_keyisNULL(these areAnswerobjects that were created before problem-builder v2.6.5 was deployed).NOTE: Before deploying v2.6.6 to production, edX will have to fake this migration and manually copy
course_idvalues intocourse_keyin batches because the productionproblem_builder_answertable is large and performing the migration in one go would degrade performance!Next, this PR also includes a migration that makes the
course_keymandatory and removes transition code that supports bothcourse_idandcourse_keycolumns.The
course_idcolumn is only deprecated at this point, but could safely be dropped in the future.Environments: edx.org and edge.edx.org
JIRA tickets: TNL-5932
Discussions: See https://github.com/edx/edx-platform/pull/14013 and JIRA ticket.
Sandbox URLs:
Built with c733391.
Partner information: hosted on edX Edge (Davidson College)
Testing instructions:
This patch should not change functionality in any way. Verify that long Answer objects still work correctly on the sandbox.
Reviewers