]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- use compat is_type_bound() function
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 22 Jan 2016 18:36:53 +0000 (13:36 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 22 Jan 2016 18:36:53 +0000 (13:36 -0500)
alembic/ddl/mysql.py
alembic/operations/batch.py

index c0232cf4e980b52622ae59173952043baffc938d..7ed742fef7813f46e7642a5771f3d613485407ae 100644 (file)
@@ -10,6 +10,7 @@ from .base import ColumnNullable, ColumnName, ColumnDefault, \
     format_server_default
 from .base import alter_table
 from ..autogenerate import compare
+from ..util.sqla_compat import _is_type_bound
 
 
 class MySQLImpl(DefaultImpl):
@@ -75,7 +76,7 @@ class MySQLImpl(DefaultImpl):
             )
 
     def drop_constraint(self, const):
-        if isinstance(const, schema.CheckConstraint) and const._type_bound:
+        if isinstance(const, schema.CheckConstraint) and _is_type_bound(const):
             return
 
         super(MySQLImpl, self).drop_constraint(const)
index cd57355f3d5ef0c3beab7b2721404b390c3e3633..d8bf0dff31756c16b238e6ad9357ec958348388b 100644 (file)
@@ -334,7 +334,7 @@ class ApplyBatchImpl(object):
         try:
             del self.named_constraints[const.name]
         except KeyError:
-            if const._type_bound:
+            if _is_type_bound(const):
                 # type-bound constraints are only included in the new
                 # table via their type object in any case, so ignore the
                 # drop_constraint() that comes here via the