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

Update migration command #432

Merged
merged 2 commits into from
Jul 20, 2022
Merged

Update migration command #432

merged 2 commits into from
Jul 20, 2022

Conversation

itsthejoker
Copy link
Member

Relevant issue: #165

Description:

Modifies transcriptions along with submissions. To properly run this, we will need to take the accounts that have already been migrated and run the following:

@blossom migrate NEW OLD
@blossom migrate OLD NEW

This will update all of the transcriptions for the affected accounts and attribute them to the new account.

Checklist:

  • Code Quality
  • Pep-8
  • Tests (if applicable)
  • Success Criteria Met
  • Inline Documentation
  • Wiki Documentation (if applicable)

@itsthejoker itsthejoker requested a review from a team as a code owner July 20, 2022 02:14
Comment on lines +456 to +459
transcriptions = Transcription.objects.filter(
submission__in=existing_submissions, author=self.old_user
)
transcriptions.update(author=self.new_user)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the submission__in check necessary here? I think we want to just migrate all transcriptions, so we could just migrate all of them.

Or does that not work with the revert?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we keep track of the submissions we act on (for revert purposes) it makes more sense to only modify the transcriptions attached to the submissions we're tracking so that we don't overreach. I agree that in most cases it'll be everything attached to the user, but I can't guarantee that.

@TimJentzsch TimJentzsch merged commit 8eb600a into master Jul 20, 2022
@TimJentzsch TimJentzsch deleted the update_migration branch July 20, 2022 14:16
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