Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django merge two migrations with the same ID?

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.

like image 787
James111 Avatar asked Oct 22 '25 22:10

James111


1 Answers

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

python manage.py makemigrations --merge
like image 91
Joe Zeleny Avatar answered Oct 25 '25 11:10

Joe Zeleny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!