django-keycloak
django-keycloak copied to clipboard
Cannot run migrations with RemoteUserOpenIdConnectProfile
Running all migrations from an initial state using the RemoteUserOpenIdConnectProfile is unsuccessful.
The order of migrations 0001, 0002 and 0003 and dependencies on the OpenIdConnectProfile make it impossible to successfully run all migrations.
I've this issue too when try to migrate using RemoteUserOpenIdConnectProfile and local user storage.
django.db.utils.ProgrammingError: relation "django_keycloak_openidconnectprofile" does not exist
Is there any workaround for this issue?
I'm too ( @swist @bossan How you solved this issue? >6 month pass Because this problem raise docker container big issue
@Malinich I forked the project and created new migrations.
@bossan Will you be opening a PR for the new migrations?
I'm still having this issue, I think it is because here the RemoteUserOpenIdConnectProfile.Meta is inheriting the abstract flag, and if you have KEYCLOAK_OIDC_PROFILE_MODEL = 'django_keycloak.RemoteUserOpenIdConnectProfile'
set it will never create the django_keycloak_remoteuseropenidconnectprofile
table.
Is there a specific reason why it needs to be abstract? if not I'll create a pull request.
to repair the migrations, it would be interesting to reset and do the --fake-initial, that way it would solve without generating so many complications
I am also stuck on this issue, I get the following error when trying to run a migration:
django.db.utils.ProgrammingError: relation "django_keycloak_openidconnectprofile" does not exist
I was struggling with the same error, but I fixed it as below. Delete or comment on lines related to the 'remote user', and migrate again. After the migration, just roll back the lines, and it works.
# KEYCLOAK_OIDC_PROFILE_MODEL = "django_keycloak.RemoteUserOpenIdConnectProfile"
# KEYCLOAK_REMOTE_USER_MODEL = "django_keycloak.remote_user.KeycloakRemoteUser"
--> + middleware