def create_index(self, name, table_name, columns, schema=None, **kw):
"""Issue a "create index" instruction using the current
migration context.
e.g.::
from alembic import op
op.create_index('ik_test', 't1', ['foo', 'bar'])
:param name: name of the index.
:param table_name: name of the owning table.
.. versionchanged:: 0.5.0
The ``tablename`` parameter is now named ``table_name``.
As this is a positional argument, the old name is no
longer present.
:param columns: a list of string column names in the
table.
:param schema: Optional schema name to operate within.
.. versionadded:: 0.4.0
"""
self.impl.create_index(
self._index(name, table_name, columns, schema=schema, **kw)
)
评论列表
文章目录