Search code examples
pythondjangopython-social-auth

relation "social_auth_usersocialauth" does not exist. Migrate does not create these tables


I am using python-social-auth. But when I run makemigrations and migrate. The tables "social_auth-*" are not created.

My settings.py looks like this

INSTALLED_APPS += (
    'social.apps.django_app.default',
)
AUTHENTICATION_BACKENDS += (
    'social.backends.facebook.FacebookOAuth2',
    'social.backends.google.GoogleOAuth2',
    'social.backends.twitter.TwitterOAuth',
)

SOCIAL_AUTH_USER_MODEL = AUTH_USER_MODEL

# Rausnehmen wenns Probleme mit der Auth. gibt

SOCIAL_AUTH_PIPELINE = (
    'social.pipeline.social_auth.social_details',
    'social.pipeline.social_auth.social_uid',
    'social.pipeline.social_auth.auth_allowed',
    'social.pipeline.social_auth.social_user',
    'social.pipeline.user.get_username',
    'social.pipeline.social_auth.associate_by_email',  # <--- enable this one. to match users per email adress
    'social.pipeline.user.create_user',
    'social.pipeline.social_auth.associate_user',
    'social.pipeline.social_auth.load_extra_data',
    'social.pipeline.user.user_details',
)

from sharadar.soc_auth_config import *

The same does work on another machine without any flaw. On this machine I receive :

Operations to perform:
    Apply all migrations: admin, auth, contenttypes, easy_thumbnailsguardian, main, myauth, sessions, social_auth
Running migrations:
    Applying myauth.0002_auto_20170220_1408... OK

social_auth is included here.

But on a new Computer I allways receive

Exception Value:    
relation "social_auth_usersocialauth" does not exist
LINE 1: ...er"."bio", "myauth_shruser"."email_verified" FROM "social_au...

When using google auth in my running django app

social_auth is not included when I run migrate

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, easy_thumbnails, guardian, myauth, sessions
Running migrations:
  No migrations to apply.

Any help is appretiated.

Kind regards

Michael


Solution

  • I had to migrate to social-auth-core as described in this dokument :

    Migrating from python-social-auth to split social

    Then all is working fine. But after this problems I am thinking about changing to all-auth.

    Regards for any help