From: Mike Bayer Date: Fri, 22 Jan 2016 18:36:53 +0000 (-0500) Subject: - use compat is_type_bound() function X-Git-Tag: rel_0_8_5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77f27bb710f5df82e9d61145c5db261d7bdc0b7e;p=thirdparty%2Fsqlalchemy%2Falembic.git - use compat is_type_bound() function --- diff --git a/alembic/ddl/mysql.py b/alembic/ddl/mysql.py index c0232cf4..7ed742fe 100644 --- a/alembic/ddl/mysql.py +++ b/alembic/ddl/mysql.py @@ -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) diff --git a/alembic/operations/batch.py b/alembic/operations/batch.py index cd57355f..d8bf0dff 100644 --- a/alembic/operations/batch.py +++ b/alembic/operations/batch.py @@ -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