-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Issue 1295. Added revert action for migration #1296
Issue 1295. Added revert action for migration #1296
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1296 +/- ##
=======================================
Coverage 97.34% 97.34%
=======================================
Files 32 32
Lines 2073 2073
=======================================
Hits 2018 2018
Misses 55 55 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. See the request to add a reverse_func, documentation, etc. per https://django-oauth-toolkit.readthedocs.io/en/latest/contributing.html#pull-requests
@@ -26,5 +26,5 @@ class Migration(migrations.Migration): | |||
name='client_secret', | |||
field=oauth2_provider.models.ClientSecretField(blank=True, db_index=True, default=oauth2_provider.generators.generate_client_secret, help_text='Hashed on Save. Copy it now if this is a new secret.', max_length=255), | |||
), | |||
migrations.RunPython(forwards_func), | |||
migrations.RunPython(forwards_func, migrations.RunPython.noop), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a reverse_func that logs a warning that previously-hashed secrets will fail to revert.
Also please fill out the checklist items (add name to Authors, etc.), update the CHANGELOG, perhaps add a warning about reverse migration of hash secrets, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@n2ygk Sorry for the so long delay in response from me. I've added warning log and updated changelog files. Could you check it please?
Fixes #
Added reverse action for migration 0006
Description of the Change
Without reverse action it's impossible to revert applied migration
Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS