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
Upgrading throws errors on migration because tables already exist #143
Comments
It looks like this is due to 1.8 adding the --fake-initial flag, which used to be applied automatically? |
You can:
|
Proposed solution 1 both loses data that is potentially useful for forensics and disrupts functionality (resets cooloff time, etc.) The correct flag to add when migrating is --fake-initial, not -fake (I believe this would skip the change in 1.6.0 to add indexes.) #146 adds that to the changelog, so other users are aware. |
@camilonova What if we already have lots of data in the same table? |
@abhigyantiwari This issue was closed over 2 years ago, is your question actually relevant? Anyway, you can just run the correct migration with fake flag so Django records the migration as done and does not attempt to run the migration SQL. You can log the SQL axes runs by from the You can refer to e.g. this blog post on handling migrations yourself. |
Caused by #136
I recently upgraded from 1.5.0 to 1.6.0 and running migrate throws the error
django.db.utils.ProgrammingError: relation "axes_accessattempt" already exists
because it's trying to run the newly added migrations files even though the tables have already been created. This is especially hard to deal with on apps deployed to Heroku
The text was updated successfully, but these errors were encountered: