]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
no SERIAL for smallinteger columns
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Sep 2006 01:37:14 +0000 (01:37 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Sep 2006 01:37:14 +0000 (01:37 +0000)
lib/sqlalchemy/databases/postgres.py

index 8234d96f060ea02f02cc2a555f4858b27b8a3d7b..7bf7869766dd6a73a30e2f27a555a1e17ab673b4 100644 (file)
@@ -490,7 +490,7 @@ class PGSchemaGenerator(ansisql.ANSISchemaGenerator):
         
     def get_column_specification(self, column, **kwargs):
         colspec = self.preparer.format_column(column)
-        if column.primary_key and not column.foreign_key and isinstance(column.type, sqltypes.Integer) and (column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional)):
+        if column.primary_key and not column.foreign_key and isinstance(column.type, sqltypes.Integer) and not isinstance(column.type, sqltypes.SmallInteger) and (column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional)):
             colspec += " SERIAL"
         else:
             colspec += " " + column.type.engine_impl(self.engine).get_col_spec()