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

[ENG-6806] manage.py command for versioned preprint migration #10883

Conversation

Ostap-Zherebetskyi
Copy link

Purpose

Turn the migration .py into an command with params and fix the typo in query

Changes

  • Added management command for preprint migration
  • Old migration file removed

QA Notes

N/A

Documentation

N/A

Side Effects

N/A

Ticket

https://openscience.atlassian.net/browse/ENG-6806

@Ostap-Zherebetskyi Ostap-Zherebetskyi marked this pull request as ready for review January 2, 2025 15:22
Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

Make some tweaks 🎆

Comment on lines 53 to 57
if not guid:
if dry_run:
self.stdout.write(self.style.ERROR(
f'Preprint object [pk={preprint.pk}] will be skipped due to missing guid.'
))
Copy link
Collaborator

Choose a reason for hiding this comment

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

My local DB is not in good shape so I happen to have preprints without guid or versioned guid. I don't think this will happen on servers but just in case we have corrupted data from ancient times, this piece skips them if it ever happens.

@cslzchen cslzchen force-pushed the feature/preprint_manage_command branch from a5644e2 to a3c2031 Compare January 2, 2025 19:46
@cslzchen cslzchen merged commit 2a5e3a8 into CenterForOpenScience:feature/preprints-doi-versioning Jan 2, 2025
4 of 6 checks passed
cslzchen added a commit that referenced this pull request Jan 2, 2025
…nage_command

[ENG-6806] manage.py command for versioned preprint migration
@Ostap-Zherebetskyi Ostap-Zherebetskyi deleted the feature/preprint_manage_command branch January 3, 2025 10:31
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