From: Mike Bayer Date: Fri, 13 Jan 2006 01:14:52 +0000 (+0000) Subject: on foreign key default schema is that of the parent column X-Git-Tag: rel_0_1_0~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9f80215918346582ba262ff1e2e63e4ea17a8f7;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git on foreign key default schema is that of the parent column --- diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index efa4c02e1c..86613ade98 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -376,8 +376,7 @@ class ForeignKey(SchemaItem): raise ValueError("Invalid foreign key column specification: " + self._colspec) if m.group(3) is None: (tname, colname) = m.group(1, 2) - # use default schema - schema = None + schema = self.parent.original.table.schema else: (schema,tname,colname) = m.group(1,2,3) table = Table(tname, self.parent.engine, mustexist=True, schema=schema) @@ -482,4 +481,4 @@ class SchemaVisitor(object): pass - \ No newline at end of file +