Pull requests

#20 Declined
Repository
Deleted repository
Branch
master (5e34e7fe64c4)
Repository
zzzeek/alembic alembic
Branch
master

Return the rev_id (contained within a namedtuple) from command.revision

Author
  1. Robbie Coomber
Reviewers
Description

Hi, I'm trying to use alembic.command.revision in a script. Currently it's awkward to get the rev_id of the created revision. Returning an object that contains it (here I've used a namedtuple for simplicity) does the right thing, what do you think?

Comments (3)

  1. Mike Bayer repo owner

    we've already have a whole Script object we can return, we might as well just return that, out of generate_revision(). Basically just send "refresh=True" to generate_revision and return that result.