-
Notifications
You must be signed in to change notification settings - Fork 20
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
Testing for migrations from sys.argv is too naive #18
Comments
Hi @intgr understood. Probably additionally, something like this could be used to check if we are inside djangos migration module...
Not sure if |
I think that won't work. A bigger issue is that with this syntax: class MyModel(models.Model):
field1 = deprecate_field(models.CharField()) The So I'm afraid returning different things based on a condition inside |
Could we use something simple like an environment variable for this? It's janky, but for folks who have complicated migrations configurations that aren't just |
Currently this project uses the following test to check whether we're migrating:
This check can be too naive, however:
MigrationAutodetector
in our test suite to ensure no missing migrations, but that fails if we adddeprecate_field()
anywhere.manage.py deploy
command which among other things callscall_command("migrate", interactive=False)
. This now prints warnings:I haven't looked into better solutions yet, just letting you know of this problem.
The text was updated successfully, but these errors were encountered: