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

fix: make migration 0013 reversible #533

Merged

Conversation

browniebroke
Copy link
Contributor

@browniebroke browniebroke commented Dec 19, 2023

Proposed changes

As mentioned #495, the migration isn't reversible. I don't think we want to change anything in the backwards operation, so we might be enough to use RunPython.noop.

Write a function to set the old fields from the _new JSON fields.

Types of changes

Please check the type of change your PR introduces:

  • Release (new release request)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

Other information

Any other information that is important to this PR such as screenshots of how
the component looks before and after the change.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 24 lines in your changes are missing coverage. Please review.

Comparison is base (e90019f) 93.63% compared to head (cc31ccc) 91.72%.

Files Patch % Lines
...ocial_django/migrations/0013_migrate_extra_data.py 7.69% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
- Coverage   93.63%   91.72%   -1.92%     
==========================================
  Files          39       39              
  Lines        1147     1172      +25     
  Branches      138      144       +6     
==========================================
+ Hits         1074     1075       +1     
- Misses         48       72      +24     
  Partials       25       25              
Flag Coverage Δ
unittests 91.72% <7.69%> (-1.92%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@browniebroke browniebroke marked this pull request as ready for review December 19, 2023 13:04
@nijel
Copy link
Member

nijel commented Dec 19, 2023

How is noop better here than failing? It just hides the fact that the data are not migrated during the reverse migration, what could lead to data loss.

@browniebroke
Copy link
Contributor Author

What kind of data loss are we talking about?

@browniebroke
Copy link
Contributor Author

Ah I see, we have the data being moved over from an old field to a new field. I get the problem you're raising now.

@nijel nijel merged commit 848f45c into python-social-auth:master Dec 21, 2023
7 of 9 checks passed
@nijel
Copy link
Member

nijel commented Dec 21, 2023

Merged, thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants