diff options
author | David Szotten <davidszotten@gmail.com> | 2014-10-16 17:25:34 +0100 |
---|---|---|
committer | David Szotten <davidszotten@gmail.com> | 2014-10-16 17:25:34 +0100 |
commit | 5d9ea4bb754f8792a897b2092b6b9e469197610c (patch) | |
tree | ec70ff9f1d4cb0949cd3542e8ffec637f1db0202 /alembic/operations.py | |
parent | ac95bad85cc6267e3ce013319ee590a084565666 (diff) | |
download | alembic-5d9ea4bb754f8792a897b2092b6b9e469197610c.tar.gz |
Create index in add_column if requested
Fixes #174
Diffstat (limited to 'alembic/operations.py')
-rw-r--r-- | alembic/operations.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/alembic/operations.py b/alembic/operations.py index 11319f7..d3cc1b0 100644 --- a/alembic/operations.py +++ b/alembic/operations.py @@ -468,6 +468,8 @@ class Operations(object): for constraint in t.constraints: if not isinstance(constraint, sa_schema.PrimaryKeyConstraint): self.impl.add_constraint(constraint) + for index in t.indexes: + self.impl._exec(sa_schema.CreateIndex(index)) def drop_column(self, table_name, column_name, **kw): """Issue a "drop column" instruction using the current |