From 33f2e2bfbbc090de9cd0e0d3bd63afda41999fa9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 18 Dec 2009 21:08:35 +0000 Subject: - Column() supports a keyword argument "sqlite_autoincrement", which applies the SQLite keyword "AUTOINCREMENT" to columns within DDL - will prevent generation of a separate PRIMARY KEY constraint. [ticket:1016] - added docs - fixed underlines in mysql.rst --- lib/sqlalchemy/sql/compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index a41a149d1..f589e4e4e 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -982,7 +982,9 @@ class DDLCompiler(engine.Compiled): # On some DB order is significant: visit PK first, then the # other constraints (engine.ReflectionTest.testbasic failed on FB2) if table.primary_key: - text += ", \n\t" + self.process(table.primary_key) + pk = self.process(table.primary_key) + if pk: + text += ", \n\t" + pk const = ", \n\t".join(p for p in (self.process(constraint) for constraint in table.constraints -- cgit v1.2.1