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

migrations not reversible #1191

Open
kostrom opened this issue Apr 19, 2024 · 2 comments
Open

migrations not reversible #1191

kostrom opened this issue Apr 19, 2024 · 2 comments
Labels

Comments

@kostrom
Copy link

kostrom commented Apr 19, 2024

During a deployment roll-back, we encountered an irreversible operation exception from django-axes. I had to --fake to rollback 0007

axes/migrations/0007_alter_accessattempt_unique_together.py
line 38 should be
migrations.RunPython(deduplicate_attempts, reverse_code=migrations.reverse_code=migrations.RunPython.noop),

The migration removes some duplicates. When rolling back, it's not necessary (or possible) to restore the duplicates, so the backwards migration should just be a noop.

@kostrom kostrom added the bug label Apr 19, 2024
@kostrom
Copy link
Author

kostrom commented Apr 19, 2024

I tried to make a MR but permission denied to submit the branch.
Also, I'm not sure how to run the tests. Does it expect me to configure a django project in the environment first?

@aleksihakli
Copy link
Member

aleksihakli commented May 7, 2024

Hi @kostrom, did you get the project up and running?

You should be able to make a PR from either GitHub desktop and/or by forking the repository and opening a PR from there, those two options are probably the easiest ones.

Documentation has a section on the development setup but GitHub Actions also runs the full test matrix with all supported Python and Django versions on a fresh PR push:

https://django-axes.readthedocs.io/en/latest/9_contributing.html#development

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

No branches or pull requests

2 participants