]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
- refactor the FK merge a bit
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Nov 2014 23:02:57 +0000 (18:02 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Nov 2014 23:02:57 +0000 (18:02 -0500)
commit96bbcf2542959b5b0dc99bbfb0db9a1db7072bc5
tree1bef6c1a3ec78296b0d7b49491de0fdc3008a9e4
parentc4409d67985fca04efdad02da8d3a7b8bc7cdc6f
- refactor the FK merge a bit
- getting at attributes of FKs varies a bit on SQLA versions,
so implement an _fk_spec() called for all FK inspection
- to enable include_object() filters and allow the FK constraint
code to flow like that of indexes/uniques, change the approach
so that we deal with an _fk_constraint_sig() object again which
contains the real ForeignKeyConstraint() within; we need this
anyway for include_object, but also allows us to use the standard
"drop_constraint" call for rendering.
- enhance tests in test_autogen_fks to support real FK databases like
Postgresql, MySQL, add in InnoDB flags and ensure that FKs refer
to real primary key constraints for PG support
- implement and test include_object() support for FKs
- inspectors all have get_foreign_keys(), no need to check
- repair the drop_constraint call to quote the "type" and table
name correctly, run all constraint drops through drop_constraint()
for rendering
- fix up schema identifiers for foreign key autogens
alembic/autogenerate/api.py
alembic/autogenerate/compare.py
alembic/autogenerate/render.py
alembic/ddl/base.py
alembic/ddl/mysql.py
tests/requirements.py
tests/test_autogen_fks.py
tests/test_autogenerate.py