- the "op()" function is now treated as an "operation", rather than a "comparison".
the difference is, an operation produces a BinaryExpression from which further operations
can occur whereas comparison produces the more restrictive BooleanExpression
+ - trying to redefine a reflected primary key column as non-primary key raises an error
- type system slightly modified to support TypeDecorators that can be overridden by the dialect
(ok, thats not very clear, it allows the mssql tweak below to be possible)
- mssql:
table._columns.add(self)
if self.primary_key:
table.primary_key.add(self)
+ elif self.key in table.primary_key:
+ raise exceptions.ArgumentError("Trying to redefine primary-key column '%s' as a non-primary-key column on table '%s'" % (self.key, table.fullname))
+ # if we think this should not raise an error, we'd instead do this:
+ #table.primary_key.remove(self)
self.table = table
if self.index:
visitor.visit_primary_key_constraint(self)
def add(self, col):
self.append_column(col)
+ def remove(self, col):
+ col.primary_key=False
+ del self.columns[col.key]
def append_column(self, col):
self.columns.add(col)
col.primary_key=True