diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-12-18 21:08:35 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-12-18 21:08:35 +0000 |
commit | 33f2e2bfbbc090de9cd0e0d3bd63afda41999fa9 (patch) | |
tree | f141986551437d7832bc71cb1d51123320077c02 /lib/sqlalchemy/sql/compiler.py | |
parent | 404be6e76155a5ef48f3d4a2c1a7e5538de135e9 (diff) | |
download | sqlalchemy-33f2e2bfbbc090de9cd0e0d3bd63afda41999fa9.tar.gz |
- 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
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |