]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- The :mod:`sqlalchemy.ext.automap` extension will now set
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 23 Sep 2014 03:00:45 +0000 (23:00 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 23 Sep 2014 03:00:45 +0000 (23:00 -0400)
commit5508388f0325ea75d311a2ef7ee4cbd6b1b8f354
tree6daed1d24ebfc49506c1ac1232a4988213ee908f
parent1dacbb25f86f828ab5df6b6424f4eb7f402a356e
- The :mod:`sqlalchemy.ext.automap` extension will now set
``cascade="all, delete-orphan"`` automatically on a one-to-many
relationship/backref where the foreign key is detected as containing
one or more non-nullable columns.  This argument is present in the
keywords passed to :func:`.automap.generate_relationship` in this
case and can still be overridden.  Additionally, if the
:class:`.ForeignKeyConstraint` specifies ``ondelete="CASCADE"``
for a non-nullable or ``ondelete="SET NULL"`` for a nullable set
of columns, the argument ``passive_deletes=True`` is also added to the
relationship.  Note that not all backends support reflection of
ondelete, but backends that do include Postgresql and MySQL.
fixes #3210
doc/build/changelog/changelog_10.rst
lib/sqlalchemy/ext/automap.py
test/ext/test_automap.py