summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-04-25 17:22:16 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-04-25 17:22:16 +0000
commit41ff863fc0669dda66f9afe6890e16172252f8b5 (patch)
tree489c4ab876d13946ee3f69402f187dee9446d573 /lib/sqlalchemy/schema.py
parent796d3acf9b85d1d86387e841a3871c81748f9a42 (diff)
downloadsqlalchemy-41ff863fc0669dda66f9afe6890e16172252f8b5.tar.gz
#553 propigate index on copied columns
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index a0dd287e3..a27adf06e 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -571,11 +571,11 @@ class Column(SchemaItem, sql._ColumnClause):
if self.index:
if isinstance(self.index, basestring):
- raise exceptions.ArgumentError("The 'index' keyword argument on Column is boolean only. To create indexes with a specific name, append an explicit Index object to the Table's list of elements.")
+ raise exceptions.ArgumentError("The 'index' keyword argument on Column is boolean only. To create indexes with a specific name, create an explicit Index object external to the Table.")
Index('ix_%s' % self._label, self, unique=self.unique)
elif self.unique:
if isinstance(self.unique, basestring):
- raise exceptions.ArgumentError("The 'unique' keyword argument on Column is boolean only. To create unique constraints or indexes with a specific name, append an explicit UniqueConstraint or Index object to the Table's list of elements.")
+ raise exceptions.ArgumentError("The 'unique' keyword argument on Column is boolean only. To create unique constraints or indexes with a specific name, append an explicit UniqueConstraint to the Table's list of elements, or create an explicit Index object external to the Table.")
table.append_constraint(UniqueConstraint(self.key))
toinit = list(self.args)
@@ -592,7 +592,7 @@ class Column(SchemaItem, sql._ColumnClause):
This is used in ``Table.tometadata``.
"""
- return Column(self.name, self.type, self.default, key = self.key, primary_key = self.primary_key, nullable = self.nullable, _is_oid = self._is_oid, case_sensitive=self._case_sensitive_setting, quote=self.quote, *[c.copy() for c in self.constraints])
+ return Column(self.name, self.type, self.default, key = self.key, primary_key = self.primary_key, nullable = self.nullable, _is_oid = self._is_oid, case_sensitive=self._case_sensitive_setting, quote=self.quote, index=self.index, *[c.copy() for c in self.constraints])
def _make_proxy(self, selectable, name = None):
"""Create a *proxy* for this column.