diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-23 22:15:09 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-23 22:15:09 +0000 |
commit | 2aa9f5541bbbaf63a9762c78db21292180b17219 (patch) | |
tree | 02e1693e5e44ec98f5b49a9ef840ef628989fc37 /lib/sqlalchemy/schema.py | |
parent | 189414fe2999d281ad8b45b89f97a3c56fc5e84b (diff) | |
download | sqlalchemy-2aa9f5541bbbaf63a9762c78db21292180b17219.tar.gz |
- "out" parameters require a type that is supported by
cx_oracle. An error will be raised if no cx_oracle
type can be found.
- Column() requires a type if it has no foreign keys (this is
not new). An error is now raised if a Column() has no type
and no foreign keys. [ticket:1705]
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index c68d1f135..80c03bbba 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -636,7 +636,9 @@ class Column(SchemaItem, expression.ColumnClause): raise exc.ArgumentError( "May not pass type_ positionally and as a keyword.") type_ = args.pop(0) - + + no_type = type_ is None + super(Column, self).__init__(name, None, type_) self.key = kwargs.pop('key', name) self.primary_key = kwargs.pop('primary_key', False) @@ -686,6 +688,9 @@ class Column(SchemaItem, expression.ColumnClause): for_update=True)) self._init_items(*args) + if not self.foreign_keys and no_type: + raise exc.ArgumentError("'type' is required on Column objects " + "which have no foreign keys.") util.set_creation_order(self) if 'info' in kwargs: |