diff options
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 0e5f3499e..b4992eec3 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1177,7 +1177,7 @@ class DDLCompiler(engine.Compiled): preparer = self.preparer text = "CREATE " if index.unique: - text += "UNIQUE " + text += "UNIQUE " text += "INDEX %s ON %s (%s)" \ % (preparer.quote(self._validate_identifier(index.name, True), index.quote), preparer.format_table(index.table), @@ -1262,7 +1262,7 @@ class DDLCompiler(engine.Compiled): return text def visit_column_check_constraint(self, constraint): - text = " CHECK (%s)" % constraint.sqltext + text = "CHECK (%s)" % constraint.sqltext text += self.define_constraint_deferrability(constraint) return text @@ -1299,8 +1299,8 @@ class DDLCompiler(engine.Compiled): def visit_unique_constraint(self, constraint): text = "" if constraint.name is not None: - text += "CONSTRAINT %s" % self.preparer.format_constraint(constraint) - text += " UNIQUE (%s)" % (', '.join(self.preparer.quote(c.name, c.quote) for c in constraint)) + text += "CONSTRAINT %s " % self.preparer.format_constraint(constraint) + text += "UNIQUE (%s)" % (', '.join(self.preparer.quote(c.name, c.quote) for c in constraint)) text += self.define_constraint_deferrability(constraint) return text |