0

I've got an application build on flask and I wanted to create a new migration for it today. When I run $python manage.py db upgrade

i got the message

raise util.CommandError('Only a single head is supported. The ' alembic.util.CommandError: Only a single head is supported. The script directory has multiple heads (due to branching), which must be resolved by manually editing the revision files to form a linear sequence. Run alembic branches to see the divergence(s).

So i run this command $alembic branches No config file 'alembic.ini' found, or file has no '[alembic]' section

Any clue on what is this about?

shanky
  • 751
  • 1
  • 16
  • 46

1 Answers1

0

The error messages are coming from alembic, so they use the command form alembic <command>, but your integrating with Flask is coming from Flask-Migrate, so you need to use the form python manage.py db branches.

To resolve multiple branches, make one of the branches point down to the other branch so that the upgrade graph is a straight line.

Andrew Magee
  • 6,506
  • 4
  • 35
  • 58
davidism
  • 121,510
  • 29
  • 395
  • 339