1

I just started my django project and after running the migrations I was trying to create superuser. Then the error popped out that I have unapplied migrations (even though I just did it). When I checked the "showmigrations" it turned out that all the migrations are doubled. I have deleted migration file so does the db (because it was empty anyway). The problem has not disappeared. Does anyone know what may be the problem?

admin
 [ ] 0001_initial 2
 [ ] 0001_initial
 [ ] 0002_logentry_remove_auto_add 2
 [ ] 0002_logentry_remove_auto_add
 [ ] 0003_logentry_add_action_flag_choices
 [ ] 0003_logentry_add_action_flag_choices 2
auth
 [ ] 0001_initial 2
 [ ] 0001_initial
 [ ] 0002_alter_permission_name_max_length 2
 [ ] 0002_alter_permission_name_max_length
 [ ] 0003_alter_user_email_max_length 2
 [ ] 0003_alter_user_email_max_length
 [ ] 0004_alter_user_username_opts 2
 [ ] 0004_alter_user_username_opts
 [ ] 0005_alter_user_last_login_null 2
 [ ] 0005_alter_user_last_login_null
 [ ] 0006_require_contenttypes_0002 2
 [ ] 0006_require_contenttypes_0002
 [ ] 0007_alter_validators_add_error_messages 2
 [ ] 0007_alter_validators_add_error_messages
 [ ] 0008_alter_user_username_max_length 2
 [ ] 0008_alter_user_username_max_length
 [ ] 0009_alter_user_last_name_max_length 2
 [ ] 0009_alter_user_last_name_max_length
 [ ] 0010_alter_group_name_max_length 2
 [ ] 0010_alter_group_name_max_length
 [ ] 0011_update_proxy_permissions 2
 [ ] 0011_update_proxy_permissions
 [ ] 0012_alter_user_first_name_max_length
 [ ] 0012_alter_user_first_name_max_length 2
contenttypes
 [ ] 0001_initial 2
 [ ] 0001_initial
 [ ] 0002_remove_content_type_name
 [ ] 0002_remove_content_type_name 2
sessions
 [ ] 0001_initial
 [ ] 0001_initial 2

In my venv for now I have django, graphene and graphene-django.

This is the error:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0001_initial 2, 0002_logentry_remove_auto_add 2, 0003_logentry_add_action_flag_choices, 0003_logentry_add_action_flag_choices 2 in admin; 0001_initial, 0001_initial 2 in sessions; 0001_initial 2, 0002_alter_permission_name_max_length 2, 0003_alter_user_email_max_length 2, 0004_alter_user_username_opts 2, 0005_alter_user_last_login_null 2, 0006_require_contenttypes_0002 2, 0007_alter_validators_add_error_messages 2, 0008_alter_user_username_max_length 2, 0009_alter_user_last_name_max_length 2, 0010_alter_group_name_max_length 2, 0011_update_proxy_permissions 2, 0012_alter_user_first_name_max_length, 0012_alter_user_first_name_max_length 2 in auth; 0001_initial 2, 0002_remove_content_type_name, 0002_remove_content_type_name 2 in contenttypes).
To fix them run 'python manage.py makemigrations --merge'

If anyone has the idea how to solve this I would really appreciate the help!

MartynaMajch
  • 118
  • 1
  • 1
  • 10

0 Answers0