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
Migration dependency issue if extending AbstractApplication #778
Comments
Same here ;( |
Since the new release 1.1.0 is impossible to extend AbstractApplication from the models to create a customized one without having migration problems. The problem persists even to the newest version. Does anyone have the same problem and how are they solving this issue? |
+1 |
Hello! Today I did workaround, it's simply.
MIGRATION_MODULES = {
'oauth2_provider': 'oauth2_lib.migrations'
}
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(oauth2_settings.APPLICATION_MODEL),
migrations.swappable_dependency(oauth2_settings.ACCESS_TOKEN_MODEL),
migrations.swappable_dependency(oauth2_settings.REFRESH_TOKEN_MODEL),
migrations.swappable_dependency(oauth2_settings.GRANT_MODEL),
] |
hey @Sharpek .. I tried your solution and couldn't get it to work. I got several other errors, but that's another issue. What I'm worried about new migrations that django-oauth-toolkit might add. You'll have to keep updating the migrations manually by copying them from your virtualenv? |
Made it work here.
|
If I extend
AbstractApplication
fromoauth2_provider
to make a custom application_model saycustom.Application
, then the migrations of this custom model should run prior too theoauth2_provider.migrations.0001_inital.py
as this migration uses the fields from the custom models.But after #531 merge, this dependency is removed, so while running migrations, custom Model's migrations are not running before the library's internal migration giving error like
The text was updated successfully, but these errors were encountered: