]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Dec 2006 16:06:14 +0000 (16:06 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Dec 2006 16:06:14 +0000 (16:06 +0000)
CHANGES
lib/sqlalchemy/databases/postgres.py

diff --git a/CHANGES b/CHANGES
index fc6ea080e6dd8c60cbcbb7d4cdaf9a47b823d9e9..7b44e4c85c45fe71d546dd278a38140cc6a53e54 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+- added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement
+
 0.3.3
 - string-based FROM clauses fixed, i.e. select(..., from_obj=["sometext"])
 - fixes to passive_deletes flag, lazy=None (noload) flag
index bb950a90cd6af593c5015d70f2153adde83680f2..9c54901aaadfc9237ae9737bb3d4abed604cb3c0 100644 (file)
@@ -500,7 +500,10 @@ class PGSchemaGenerator(ansisql.ANSISchemaGenerator):
     def get_column_specification(self, column, **kwargs):
         colspec = self.preparer.format_column(column)
         if column.primary_key and len(column.foreign_keys)==0 and column.autoincrement 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"
+            if isinstance(column.type, PGBigInteger):
+                colspec += " BIGSERIAL"
+            else:
+                colspec += " SERIAL"
         else:
             colspec += " " + column.type.engine_impl(self.engine).get_col_spec()
             default = self.get_column_default_string(column)