Giter Site home page Giter Site logo

Comments (8)

lukasz-karolewski avatar lukasz-karolewski commented on June 1, 2024 4

i'm getting

python manage.py migrate
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0006_partial, 0004_auto_20160423_0400 in social_django).
To fix them run 'python manage.py makemigrations --merge'
(test) ubuntu@ubuntu-xenial:~/test$ python manage.py makemigrations --merge
No conflicts detected to merge.
(test) ubuntu@ubuntu-xenial:~/test$ python manage.py makemigrations social_django --merge
No conflicts detected to merge.

...

from social-app-django.

idrummer83 avatar idrummer83 commented on June 1, 2024

hi
i have the same problem with migration

C:\Users\Developer\PycharmProjects\lvov-landing>python manage.py migrate
Operations to perform:
Synchronize unmigrated apps: djangocms_flash, plantour, djangocms_file, rest_framework, djangocms_inherit, djangocms_video, ckeditor_uploader, djangocms_column, djangocms_googlemap, modeltranslation
, social_auth, djangocms_admin_style, sitemaps, corsheaders, djangocms_picture, sekizai, adminsortable2, djangocms_style, treebeard, thumbnail, djangocms_teaser
Apply all migrations: menus, reversion, contacts, admin, djangocms_link, sessions, question, sertificat, auth, sites, reviews, food, contenttypes, tours, whywe, surprise, hotels, cms, gallery, djang
ocms_text_ckeditor
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
Applying tours.0015_delete_maintoursmenu...Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\core\management_init_.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\core\management_init_.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **options.dict)
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\core\management\base.py", line 338, in execute
output = self.handle(*args, **options)
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\core\management\commands\migrate.py", line 161, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\db\migrations\executor.py", line 68, in migrate
self.apply_migration(migration, fake=fake)
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\db\migrations\executor.py", line 96, in apply_migration
if self.detect_soft_applied(migration):
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\db\migrations\executor.py", line 140, in detect_soft_applied
apps = project_state.render()
File "C:\Users\Developer\PycharmProjects\virtal-env\lvov\lib\site-packages\django\db\migrations\state.py", line 75, in render
"for more" % new_unrendered_models
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'djangocms_flash.Flash'>, <ModelState: 'djangocms_file.File'>, <ModelState: 'djangocms_inherit.InheritPagePlacehold
er'>, <ModelState: 'djangocms_video.Video'>, <ModelState: 'djangocms_column.MultiColumns'>, <ModelState: 'djangocms_column.Column'>, <ModelState: 'djangocms_googlemap.GoogleMap'>, <ModelState: 'django
cms_picture.Picture'>, <ModelState: 'djangocms_style.Style'>, <ModelState: 'djangocms_teaser.Teaser'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

from social-app-django.

omab avatar omab commented on June 1, 2024

@snj, are the python-social-auth migrations applied? The migrations in social_django are configured with the replaces rules to properly tell django to identify the old ones as valid if applied. Check the migrations applied in the DB, also running with --fake worked for somebody that had the migrations applied.

from social-app-django.

pydolan avatar pydolan commented on June 1, 2024

For me, I had the python-social-auth migrations duplicated in django_migrations under both the "social_auth" app and "default" app (migations 0000 - 0004). In #22, the OP updated the default names, and for me, I just deleted them. These entries in django_migrations existed from the old python package (python-social-auth==0.3.4).

Perhaps update the docs on migrating from python-social-auth to social-auth-app-django & social-auth-core to mention this problem?

from social-app-django.

nijel avatar nijel commented on June 1, 2024

The problem seems to be that 0005_auto_20160727_2333 which has been applied previously is not visible now.

This is caused by replaces field in that migration as currently it replaces both migrations from default and social_auth. As this migration was never shipped with default and migration in social_auth does not replace the default one, it does not exist for anybody and thus Django does not see it.

Should be fixed by #25

from social-app-django.

cmichal avatar cmichal commented on June 1, 2024

Hi,
After upgrade from old pytho-social-auth lib I'm also experiencing this issue:
(...)
django.db.migrations.graph.NodeNotFoundError: Migration social_django.0002_add_related_name dependencies reference nonexistent parent node (u'social_django', u'0001_initial')

New version (1.0.1) does not fix this. I've also have this 0001_initial migrations with app=dafault in db. What is the best way to fix that apart from running SQL statement directly on prod DB? I would prefere to write custom migration - I tried, with use of:
run_before = [
('social_django', '0001_initial'),
]
operations = [
migrations.RunSQL('''
update django_migrations set app='social_django' where app='default';''')
]

but I still get this error. Any idea how to solve this?

from social-app-django.

nijel avatar nijel commented on June 1, 2024

@cmichal You need to have both social_django and default in the database (for all 0001 - 0004, the 0005 never existed with default app).

It would be fixed by upgrading first to python-social-auth 0.2.21 and then to 0.3.x. I'm not really sure if it's doable to support upgrade from any intermediate state. Obviously there were more issues folded in here and I've fixed just one of them (upgrade from 0.2.20+).

from social-app-django.

nijel avatar nijel commented on June 1, 2024

I've created #28 for this.

from social-app-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.