New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should "stamp heads" work? #267

Closed
sqlalchemy-bot opened this Issue Jan 23, 2015 · 10 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Jan 23, 2015

Migrated issue, originally created by MichaelE (@miracle2k)

I want to stamp all heads. It currently tells me:

INFO  [alembic.migration] Context impl MySQLImpl.
INFO  [alembic.migration] Will assume non-transactional DDL.
ERROR [alembic.util] Multiple head revisions are present for given argument 'heads'; please specify a specific target revision, '<branchname>@heads' to narrow to a specific head, or 'heads' for all heads
  FAILED: Multiple head revisions are present for given argument 'heads'; please specify a specific target revision, '<branchname>@heads'
  to narrow to a specific head, or 'heads' for all heads
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jan 23, 2015

Michael Bayer (@zzzeek) wrote:

  • Added support for "alembic stamp" to work when given "heads" as an
    argument, when multiple heads are present.
    fixes #267

56d56f5

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jan 23, 2015

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jan 24, 2015

Michael Bayer (@zzzeek) wrote:

so I sort of left this off at first because stamp was so difficult to get it working in the first place, I didn't feel like pushing it. But as you can see this was a simple change.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jan 24, 2015

MichaelE (@miracle2k) wrote:

Just amazing, thanks.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 7, 2015

MichaelE (@miracle2k) wrote:

I have run into a problem trying to use this, which is that

"stamp foo@heads"

is idempotent, but

stamp heads

fails when there a branch doesn't need to be stamped:

  File "<string>", line 7, in run_migrations
  File "/Users/michael/.virtualenvs/cms26/lib/python2.6/site-packages/alembic/environment.py", line 742, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/Users/michael/.virtualenvs/cms26/lib/python2.6/site-packages/alembic/migration.py", line 316, in run_migrations
    head_maintainer.update_to_step(step)
  File "/Users/michael/.virtualenvs/cms26/lib/python2.6/site-packages/alembic/migration.py", line 475, in update_to_step
    self._insert_version(vers)
  File "/Users/michael/.virtualenvs/cms26/lib/python2.6/site-packages/alembic/migration.py", line 424, in _insert_version
    assert version not in self.heads
AssertionError
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 7, 2015

Michael Bayer (@zzzeek) wrote:

stamp was really hard to write.... :) ok

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 7, 2015

Michael Bayer (@zzzeek) wrote:

fix one remaining aspect

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 7, 2015

Changes by Michael Bayer (@zzzeek):

  • changed status to reopened
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 9, 2015

Michael Bayer (@zzzeek) wrote:

  • additional fix which impacts #267. fix filtered_heads() to accommodate
    being given "heads" as the target so that it will in fact match when all heads
    are given. fixes #267

e8a0c74

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 9, 2015

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment