diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-13 16:22:01 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-13 16:22:01 -0400 |
commit | 4077e99f3f51789474bfe4f7ebee666682bf5cdd (patch) | |
tree | eb1a213dfb53e75517a24d40cccd6b2e4440408b | |
parent | a54b783c49b6f37654100fb6b129a14bddd6424a (diff) | |
download | sqlalchemy-4077e99f3f51789474bfe4f7ebee666682bf5cdd.tar.gz |
- tweaks regarding the use_alter update
-rw-r--r-- | doc/build/orm/relationship_persistence.rst | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/exc.py | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/doc/build/orm/relationship_persistence.rst b/doc/build/orm/relationship_persistence.rst index 6d2ba7882..8af96cbd6 100644 --- a/doc/build/orm/relationship_persistence.rst +++ b/doc/build/orm/relationship_persistence.rst @@ -56,8 +56,7 @@ have been INSERTED; it also causes the rows to be de-associated with each other via UPDATE before a DELETE is emitted. The flag should be placed on just *one* of the relationships, preferably the many-to-one side. Below we illustrate -a complete example, including two :class:`.ForeignKey` constructs, one which -specifies :paramref:`~.ForeignKey.use_alter` to help with emitting CREATE TABLE statements:: +a complete example, including two :class:`.ForeignKey` constructs:: from sqlalchemy import Integer, ForeignKey, Column from sqlalchemy.ext.declarative import declarative_base @@ -77,7 +76,6 @@ specifies :paramref:`~.ForeignKey.use_alter` to help with emitting CREATE TABLE widget_id = Column(Integer, primary_key=True) favorite_entry_id = Column(Integer, ForeignKey('entry.entry_id', - use_alter=True, name="fk_favorite_entry")) name = Column(String(50)) @@ -145,7 +143,7 @@ as illustrated below:: ForeignKeyConstraint( ["widget_id", "favorite_entry_id"], ["entry.widget_id", "entry.entry_id"], - name="fk_favorite_entry", use_alter=True + name="fk_favorite_entry" ), ) diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index c0d51382d..9b27436b3 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -54,8 +54,7 @@ class CircularDependencyError(SQLAlchemyError): or pre-deassociate one of the foreign key constrained values. The ``post_update`` flag described at :ref:`post_update` can resolve this cycle. - * In a :meth:`.MetaData.create_all`, :meth:`.MetaData.drop_all`, - :attr:`.MetaData.sorted_tables` operation, two :class:`.ForeignKey` + * In a :attr:`.MetaData.sorted_tables` operation, two :class:`.ForeignKey` or :class:`.ForeignKeyConstraint` objects mutually refer to each other. Apply the ``use_alter=True`` flag to one or both, see :ref:`use_alter`. |