Autogenerate creates indexes separately on new tables #1057
Answered
by
zzzeek
ziima
asked this question in
Usage Questions
-
I noticed autogenerate to create indexes on new tables separately. Autogenerate output (batch mode on) for a new table looks like: def upgrade():
op.create_table(
"my_table",
# ... columns ...
# ... constraints ...
)
with op.batch_alter_table("my_table", schema=None) as batch_op:
batch_op.create_index(batch_op.f("my_table_status_key"), ["status"], unique=False) While it seems that having the def upgrade():
op.create_table(
"my_table",
# ... columns ...
# ... constraints ...
Index(op.f("my_table_status_key"), "status", unique=False)
) Is there a reason for autogenerate to separate creation of indexes, or is it just an unoptimized part of autogenerate? |
Beta Was this translation helpful? Give feedback.
Answered by
zzzeek
Jun 16, 2022
Replies: 1 comment
-
there's no reason it looks like an implementation artifact that I agree is not ideal, and I would support fixing it for this case. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ziima
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
there's no reason it looks like an implementation artifact that I agree is not ideal, and I would support fixing it for this case.