Skip to content

Invalidate importlib caches if command is makemigrations #13

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

Closed
bckohan opened this issue Jun 10, 2024 · 0 comments
Closed

Invalidate importlib caches if command is makemigrations #13

bckohan opened this issue Jun 10, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bckohan
Copy link
Owner

bckohan commented Jun 10, 2024

some commands generation additional python files. importlib caches directory reads which means if you run makemigrations followed by migrate in the same process, migrate will not find the new migration files. This can be fixed by a call to importlib.invalidate_caches(). Users could do this themselves using pre and post hooks (#9) but makemigrations -> migrate is probably a common enough flow that it warrants handling this special case internally automatically.

@bckohan bckohan added the enhancement New feature or request label Jun 10, 2024
@bckohan bckohan self-assigned this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant