From cf8e5e3cf5b0e1be05a611c8828690acfcd2b9fa Mon Sep 17 00:00:00 2001 From: donkopotamus Date: Fri, 17 Jan 2014 11:00:24 +1300 Subject: Bug Fix: Stop generating bad sql if an empty UniqueConstraint() is given --- lib/sqlalchemy/sql/compiler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql/compiler.py') 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 " % \ -- cgit v1.2.1