Issue #60 new

autogenerate for sequences, as well as create_sequence()/drop_sequence()

Anonymous created an issue

No description provided.

Comments (6)

  1. Anonymous

    Try this sqlalchemy declarative base:

    id = db.Column(db.Integer, db.Sequence("s_%s" % __tablename__), primary_key=True)

    but alembic revision autogeneration make migration scrip without any sequence.

  2. Mike Bayer repo owner

    autogenerate doesn't look at sequences right now, no.

    there's a lot of TODOs for autogenerate, mainly schema support.

    I will reiterate that you don't need autogenerate or explicit operations methods to use sequences with alembic. this will work right now:

    from sqlalchemy.schema import Sequence, CreateSequence
  3. Anonymous

    Thank you for advice. I will try to use this example. Sure that autogenerate would have done it much faster than I. Hopefully that this enhancement soon will be.

    Do you think about store upgrade/downgrade migrations scripts in native SQL? I think it will be easy more.

  4. Log in to comment