diff options
author | donkopotamus <derek.harland@finq.co.nz> | 2014-01-17 11:00:24 +1300 |
---|---|---|
committer | donkopotamus <derek.harland@finq.co.nz> | 2014-01-17 11:00:24 +1300 |
commit | cf8e5e3cf5b0e1be05a611c8828690acfcd2b9fa (patch) | |
tree | 987e7b4f0ff40a686d600549d03b43e34d6aa9ac /lib/sqlalchemy/sql/compiler.py | |
parent | 35935489608c6a896790ed0c51c3ea4b4eb6186f (diff) | |
download | sqlalchemy-cf8e5e3cf5b0e1be05a611c8828690acfcd2b9fa.tar.gz |
Bug Fix: Stop generating bad sql if an empty UniqueConstraint() is given
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index ade3c623a..5c5bfad55 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2511,6 +2511,8 @@ class DDLCompiler(Compiled): return preparer.format_table(table) def visit_unique_constraint(self, constraint): + if len(constraint) == 0: + return '' text = "" if constraint.name is not None: text += "CONSTRAINT %s " % \ |