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: loader: warn in case an explicit migration module is not found #4950

Closed

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jul 3, 2015

Logging a warning in this case helps with tracking down errors where you
have an invalid entry in MIGRATION_MODULES.

Does this make sense?
Is it OK to add logging here?

Logging a warning in this case helps with tracking down errors where you
have an invalid entry in MIGRATION_MODULES.
@blueyed blueyed changed the title migrations: loader: warn in case an explicit migration is not found migrations: loader: warn in case an explicit migration module is not found Jul 4, 2015
@timgraham
Copy link
Member

I think this is somewhat dependent on whether or not we require migrations in 1.9. Is there a reason not to raise an error in this case? Possibly a system check could be added for invalid MIGRATION_MODULES entries, though if migrations are required for apps, the issue seems obsolete. I added a link to this PR to https://code.djangoproject.com/ticket/25109.

@timgraham timgraham closed this Aug 1, 2015
@blueyed
Copy link
Contributor Author

blueyed commented Aug 1, 2015

Is there a reason not to raise an error in this case?

Would be good, too - given that there will be an (obfuscated) error later already (InvalidBasesError).

I think a combination of this PR and the patch at from https://code.djangoproject.com/ticket/25109 might be good: do not add it to self.unmigrated_apps and output a warning.
A system check might be good, too - but it might not be feasible to check this always?!

though if migrations are required for apps, the issue seems obsolete

Why?

@timgraham
Copy link
Member

Re: "Why?" -- If migrations are required, I guess "unmigrated apps" would go away and there would be an exception for apps missing migrations. Obsolete in the sense of "if we have an exception, we don't need a warning".

@blueyed
Copy link
Contributor Author

blueyed commented Aug 2, 2015

Obsolete in the sense of "if we have an exception, we don't need a warning".

Yes, but the error would be still clearer if there was an additional warning or more explicit error about the root cause.

@blueyed blueyed deleted the log-warn-explicit-migration-not-found branch March 25, 2017 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants