summaryrefslogtreecommitdiff
path: root/alembic/environment.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-11-02 18:33:51 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-11-02 18:33:51 -0500
commite7d17fb89bf3c0f4a8ebc72947765db62e9ab0f1 (patch)
treed711c34935fe86aa87d5514147fe086715627b23 /alembic/environment.py
parent0fa7716ffe6ac1261c9446162d6486f0411ed4df (diff)
downloadalembic-e7d17fb89bf3c0f4a8ebc72947765db62e9ab0f1.tar.gz
- Indexes and unique constraints are now included in the
:paramref:`.EnvironmentContext.configure.include_object` hook. Indexes are sent with type ``"index"`` and unique constraints with type ``"unique_constraint"``. fixes #203
Diffstat (limited to 'alembic/environment.py')
-rw-r--r--alembic/environment.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/alembic/environment.py b/alembic/environment.py
index 1dfb000..59718e8 100644
--- a/alembic/environment.py
+++ b/alembic/environment.py
@@ -464,12 +464,19 @@ class EnvironmentContext(object):
The function accepts the following positional arguments:
* ``object``: a :class:`~sqlalchemy.schema.SchemaItem` object such
- as a :class:`~sqlalchemy.schema.Table` or
- :class:`~sqlalchemy.schema.Column` object
+ as a :class:`~sqlalchemy.schema.Table`,
+ :class:`~sqlalchemy.schema.Column`,
+ :class:`~sqlalchemy.schema.Index`
+ or :class:`~sqlalchemy.schema.UniqueConstraint` object
* ``name``: the name of the object. This is typically available
via ``object.name``.
* ``type``: a string describing the type of object; currently
- ``"table"`` or ``"column"``
+ ``"table"``, ``"column"``, ``"index"`` or ``"unique_constraint"``.
+
+ .. versionadded:: 0.7.0 Support for indexes and unique constraints
+ within the
+ :paramref:`~.EnvironmentContext.configure.include_object` hook.
+
* ``reflected``: ``True`` if the given object was produced based on
table reflection, ``False`` if it's from a local :class:`.MetaData`
object.