1

I'm working to modify a cookiecutter Flask app.

locally I have deleted the migration folder and sqllite db a couple of times during development. I've pushed my chnages to heroku.

When trying to migrate the heroku postgresdb :

$ heroku run python manage.py db upgrade
.....
alembic.util.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads

following http://alembic.readthedocs.org/en/latest/branches.html I tried:

$ heroku run python manage.py db merge heads
Running python manage.py db merge heads on myapp... up, run.9635
  Generating /app/migrations/versions/35888775_.py ... done

Then I tried:

$ heroku run python manage.py db upgrade
Running python manage.py db upgrade on myapp... up, run.7021
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
    ....
    "%s@head" % branch_label if branch_label else "head")
alembic.util.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head
, or 'heads' for all heads

How can I merge the revision heads into one and make sure this is synced with my development version?

user1592380
  • 34,265
  • 92
  • 284
  • 515

1 Answers1

0

I contacted heroku support and got the following back (which worked for me):

Hi,

To remove a folder from your local repository, git rm needs to be run. Could you please try something like below?

$ git rm -r migrations
$ git commit -m 'Remove migrations directory'
$ git push heroku master

To see differences between actual files and what are registered onto your local repository, git status may be useful.

Please let us know if you have any difficulty here.

user1592380
  • 34,265
  • 92
  • 284
  • 515