ddl sorting of tables doesn't occur for SQLite, due to "no alter support"

Issue #3378 resolved
Michael Bayer
repo owner created an issue

due to #3282, we turn of FK sorting altogether if there's no ALTER support, for whatever reason only in the DROP and not the CREATE (https://bitbucket.org/zzzeek/sqlalchemy/src/4442eb3e1edea1652ce0ab5f4d16925207dcf2c5/lib/sqlalchemy/sql/ddl.py?at=master#cl-810). Which breaks if you have constraints enabled on SQLite.

Comments (4)

  1. Michael Bayer reporter

    I think we don't have this limit in the CREATE because SQLite only cares about constraint violations if the tables actually have data. So this is a leakage of backend-specific stuff here.

  2. Michael Bayer reporter
    • repair a regression caused by #3282, where we no longer were applying any topological sort to tables on SQLite. See the changelog for details, but we now continue to sort tables for SQLite on DROP, prohibit the sort from considering alter, and only warn if we encounter an unresolvable cycle, in which case, then we forego the ordering. use_alter as always is used to break such a cycle. fixes #3378

    → <<cset 39978060b0d8>>

  3. Log in to comment