- changed status to resolved
contraint name for column level constraints
Issue #2305
resolved
need to put this only on those DBs which support it (or override those that don't support it).
So far PG and SQLite seem to support it, MySQL does not:
--- a/lib/sqlalchemy/sql/compiler.py Thu Oct 20 15:00:17 2011 -0400
+++ b/lib/sqlalchemy/sql/compiler.py Fri Oct 21 20:07:28 2011 -0400
@@ -1403,7 +1403,11 @@
return text
def visit_column_check_constraint(self, constraint):
- text = "CHECK (%s)" % constraint.sqltext
+ text = ""
+ if constraint.name is not None:
+ text += "CONSTRAINT %s " % \
+ self.preparer.format_constraint(constraint)
+ text += "CHECK (%s)" % constraint.sqltext
text += self.define_constraint_deferrability(constraint)
return text
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.7.4 (automated comment)
- Log in to comment
133a0b2460f4c71692795ebbe52f9e521bb8782c