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

op.create_table emit_events arg is an invalid argument #81

sqlalchemy-bot opened this Issue Oct 20, 2012 · 2 comments


None yet
1 participant

sqlalchemy-bot commented Oct 20, 2012

Migrated issue, originally created by Robert Kopaczewski (@23doors)

According to docs, emit_events=True should imply that before_create and after_create events will be emitted.

That's not the case.

sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=80), nullable=True),
sa.Column('description', sa.String(length=255), nullable=True),

Results in:
TypeError: Invalid argument(s) for Table: ['emit_events']

Is there some other way to create custom indexes with alembic?


This comment has been minimized.

sqlalchemy-bot commented Oct 20, 2012

Michael Bayer (@zzzeek) wrote:

that documentation note is apparently an inadvertent checkin, is removed in 894afbf.

The feature it discusses is more related to PG's ENUM type, which can now be created directly now. Alembic fires off the before_create() and after_create() events for CreateTable in all cases. However, using these kinds of events directly in an Alembic script just makes the script more complicated, as an alembic script is just a straight list of DDL to emit, you just add any additional DDL inline.

The term "custom indexes" can mean several things. If it means, you just want to create an index explicitly, you just use op.create_index(). If it means, you want to create an index that makes use of some unsupported syntax, like a Postgresql functional index, you write out the "CREATE INDEX" statement as a string and invoke it via op.execute().


This comment has been minimized.

sqlalchemy-bot commented Oct 20, 2012

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