]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Implement native boolean check constraint flag in test suite
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 18 May 2018 15:11:49 +0000 (11:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 18 May 2018 15:11:49 +0000 (11:11 -0400)
This is based on
https://github.com/zzzeek/sqlalchemy/commit/d2bacad469c0b07cc707b563e37e835abcf96eb8
which adds further specificity to SQL Server's boolean behaviors,
the test suite here expects a CHECK constraint to be rendered.

Change-Id: I2cce018135f292c7eeddcdbc724668ee9d9c9c48

alembic/testing/fixtures.py

index e6c16dd59c94c8caa4894fb7b68def354d012158..86d40a29adf0ebe457d9117bf86d67712f0cf979 100644 (file)
@@ -146,6 +146,9 @@ def op_fixture(
     ctx_dialect = _get_dialect(dialect)
     if native_boolean is not None:
         ctx_dialect.supports_native_boolean = native_boolean
+        # this is new as of SQLAlchemy 1.2.7 and is used by SQL Server,
+        # which breaks assumptions in the alembic test suite
+        ctx_dialect.non_native_boolean_check_constraint = True
     if not as_sql:
         def execute(stmt, *multiparam, **param):
             if isinstance(stmt, string_types):