summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-02-14 23:41:17 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-02-14 23:41:17 +0000
commit14b3a913ac29dd8b37a616701bf13fb6541f5370 (patch)
tree9ddc9242384812e483f57121f8b7962983cbc08c /lib/sqlalchemy
parent911c1ec51336ca143c67da7f0b7763f2396d2547 (diff)
downloadsqlalchemy-14b3a913ac29dd8b37a616701bf13fb6541f5370.tar.gz
fixing recent schema.py changes to work with oracle 'owner' attributerel_0_4_3
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/schema.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 3a2ff97a7..a3aa9ecc6 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -196,6 +196,7 @@ class Table(SchemaItem, expression.TableClause):
super(Table, self).__init__(name)
self.metadata = metadata
self.schema = kwargs.pop('schema', None)
+ self.owner = kwargs.pop('owner', None)
self.indexes = util.Set()
self.constraints = util.Set()
self._columns = expression.ColumnCollection()
@@ -232,7 +233,13 @@ class Table(SchemaItem, expression.TableClause):
schema = kwargs.pop('schema', None)
if schema and schema != self.schema:
raise exceptions.ArgumentError("Can't change schema of existing table from '%s' to '%s'", (self.schema, schema))
-
+ owner = kwargs.pop('owner', None)
+ if owner:
+ if not self.owner:
+ self.owner = owner
+ elif owner != self.owner:
+ raise exceptions.ArgumentError("Can't change owner of existing table from '%s' to '%s'", (self.owner, owner))
+
include_columns = kwargs.pop('include_columns', None)
if include_columns:
for c in self.c:
@@ -246,12 +253,11 @@ class Table(SchemaItem, expression.TableClause):
the 'useexisting' flag overrides this.
"""
- return bool(args) or bool(util.Set(kwargs).difference(['autoload', 'autoload_with', 'schema']))
+ return bool(args) or bool(util.Set(kwargs).difference(['autoload', 'autoload_with', 'schema', 'owner']))
def __post_init(self, *args, **kwargs):
self.quote = kwargs.pop('quote', False)
self.quote_schema = kwargs.pop('quote_schema', False)
- self.owner = kwargs.pop('owner', None)
if kwargs.get('info'):
self._info = kwargs.pop('info')