You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Column onupdate clause erroneously copied to history table #47
If I have a datetime (or any other column type) column in a table with onupdate= and include this in the history table, the onupdate clause gets erroneously (I'd argue) "copied" to the history table.
Example:
class Article(Base):
__versioned__ = {'include' : ['last_update', ]}
id = sa.Column(sa.Integer, primary_key=True)
body = sa.Column(sa.UnicodeText)
last_update = sa.Column(sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False)
The articles table behaves correctly, in that the last_update column is updated each time a record is changed. However, the _history table, due to the update of end_transaction_id (I presume) fails to preserve the value of the column, so the second latest row effectively has the last_update value of the most recent update.
Activity
kvesteri commentedon Feb 27, 2014
Hi, could you make a simple test case for this one which outlines the expected behaviour?
kvesteri commentedon Feb 27, 2014
Don't worry about the test case, made it already there. Fixed as of 0.10.3.
karih commentedon Feb 27, 2014
That was fast, thanks!
Fix #47