diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-21 15:39:48 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-21 15:39:48 -0400 |
commit | 2272f30af435c5283157724bbb16fb0a573159ce (patch) | |
tree | a74af95302914877bbc3a81f23cca15bdec1d731 /lib/sqlalchemy/sql | |
parent | 81eefb2f13a9c854e1dcd924550d0c36553e930a (diff) | |
download | sqlalchemy-2272f30af435c5283157724bbb16fb0a573159ce.tar.gz |
- [feature] Added "MATCH" clause to ForeignKey,
ForeignKeyConstraint, courtesy Ryan Kelly.
[ticket:2502]
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index fd7e7d773..8a8c773f8 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1726,6 +1726,7 @@ class DDLCompiler(engine.Compiled): ', '.join(preparer.quote(f.column.name, f.column.quote) for f in constraint._elements.values()) ) + text += self.define_constraint_match(constraint) text += self.define_constraint_cascades(constraint) text += self.define_constraint_deferrability(constraint) return text @@ -1765,6 +1766,12 @@ class DDLCompiler(engine.Compiled): text += " INITIALLY %s" % constraint.initially return text + def define_constraint_match(self, constraint): + text = "" + if constraint.match is not None: + text += " MATCH %s" % constraint.match + return text + class GenericTypeCompiler(engine.TypeCompiler): def visit_CHAR(self, type_): |