summaryrefslogtreecommitdiff
path: root/alembic
diff options
context:
space:
mode:
authorMike Bayer <classic@zzzcomputing.com>2014-10-10 15:25:15 -0400
committerMike Bayer <classic@zzzcomputing.com>2014-10-10 15:25:15 -0400
commit091afc0b0fae3c91d8e2d1077229383ce0b3dae3 (patch)
tree4769b0cf85000497ea81f4486a1c831c6cbd35d7 /alembic
parentb98df9bf13b5f65dbee4b728c6c78bf2560fa522 (diff)
parenta7bbc7db29e40c03cec20ba446bad5a254c5de71 (diff)
downloadalembic-091afc0b0fae3c91d8e2d1077229383ce0b3dae3.tar.gz
Merged in ltvolks/alembic/docs-153 (pull request #28)
Update documentation for create_index parameters
Diffstat (limited to 'alembic')
-rw-r--r--alembic/operations.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/alembic/operations.py b/alembic/operations.py
index 9124f32..11319f7 100644
--- a/alembic/operations.py
+++ b/alembic/operations.py
@@ -822,7 +822,8 @@ class Operations(object):
self._table(name, **kw)
)
- def create_index(self, name, table_name, columns, schema=None, **kw):
+ def create_index(self, name, table_name, columns, schema=None,
+ unique=False, quote=None, **kw):
"""Issue a "create index" instruction using the current
migration context.
@@ -864,10 +865,26 @@ class Operations(object):
.. versionadded:: 0.7.0 'schema' can now accept a
:class:`~sqlalchemy.sql.elements.quoted_name` construct.
+ :param unique: If True, create a unique index.
+
+ :param quote:
+ Force quoting of this column's name on or off, corresponding
+ to ``True`` or ``False``. When left at its default
+ of ``None``, the column identifier will be quoted according to
+ whether the name is case sensitive (identifiers with at least one
+ upper case character are treated as case sensitive), or if it's a
+ reserved word. This flag is only needed to force quoting of a
+ reserved word which is not known by the SQLAlchemy dialect.
+
+ :param \**kw: Additional keyword arguments not mentioned above are
+ dialect specific, and passed in the form ``<dialectname>_<argname>``.
+ See the documentation regarding an individual dialect at
+ :ref:`dialect_toplevel` for detail on documented arguments.
"""
self.impl.create_index(
- self._index(name, table_name, columns, schema=schema, **kw)
+ self._index(name, table_name, columns, schema=schema,
+ unique=unique, quote=quote, **kw)
)
@util._with_legacy_names([('tablename', 'table_name')])