4

I had an old git branch which has a migration that was never merged into our main branch. Since I made that migration, 14 or so migrations have been made.

I have since rebased my old branch into our current branch and have two migrations:

  1. 0044_auto_20160810_1128
  2. 0044_auto_20160823_1613

I've tried running python manage.py migrate --merge- this just returns the following text:

usage: manage.py migrate [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS]
                         [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                         [--noinput] [--no-initial-data] [--database DATABASE]
                         [--fake] [--fake-initial] [--list]
                         [app_label] [migration_name]
manage.py migrate: error: unrecognized arguments: --merge

I found this command from the following stack question:

Django South migration conflict while working in a team

All I'm trying todo is merge the two 0044 migrations so when I push to production it won't error.

Community
  • 1
  • 1
James111
  • 15,378
  • 15
  • 78
  • 121

2 Answers2

10

This is an old question but in case anyone finds it in the future, the command is

python manage.py makemigrations --merge
Joe Zeleny
  • 884
  • 7
  • 10
0

I too faced the same issue, solved by manually adding the missing part of migration from both same files to one file and deleting the other duplicate file and successfully migrated without any issue.

So basically removed all duplicate files by manually merging and maintaining proper order of dependencies.

Akshay
  • 1,019
  • 12
  • 21