use type_affinity instead of isinstance() for integer check within _autoincrement_column

Issue #2005 resolved
Mike Bayer repo owner created an issue
diff -r a590e5db8aece17e93371bca290d2e205528e34c lib/sqlalchemy/schema.py
--- a/lib/sqlalchemy/schema.py  Sat Dec 18 13:05:20 2010 -0500
+++ b/lib/sqlalchemy/schema.py  Sat Dec 18 15:31:16 2010 -0500
@@ -324,7 +324,7 @@
     def _autoincrement_column(self):
         for col in self.primary_key:
             if col.autoincrement and \
-                isinstance(col.type, types.Integer) and \
+                issubclass(col.type._type_affinity, types.Integer) and \
                 not col.foreign_keys and \
                 isinstance(col.default, (type(None), Sequence)):

Comments (2)

  1. Log in to comment