0

When running the alembic revision command to generate a new revision script I get the following (not particularly helpful) error:

 $ alembic -c <my-config>.ini revision -m "example message"
   Only a single head supported so far...

The implication seems to be I somehow ended up with two HEADs in my Alembic system--although I'm not really certain what this means.

In our workflow migration scripts are written by multiple developers so my guess would be somehow two developers concurrently created a revision which refers to the same "revises" identifier.

  • Is that what this error message means?
  • What is the best way to identify the offending migration scripts?
  • What is the best way to fix this error (keeping in mind that I believe all migrations in our version control have been applied to the DB already)?
Chris W.
  • 37,583
  • 36
  • 99
  • 136

1 Answers1

1

This error means you have two revisions referencing the same down_revision. Just look at the last few revisions you've created and see which ones reference the same down_revision.

# revision identifiers, used by Alembic.
revision = '234342f7fc2d'
down_revision = '3981426f2c20'

My offending revision ended up being an "extra" un-used one, so I just deleted it.

Chris W.
  • 37,583
  • 36
  • 99
  • 136