I've inherited an older database that was setup with a "on update CURRENT_TIMESTAMP" put on a field that should only describe an item's creation. With PHP I have been using "timestamp=timestamp" on UPDATE clauses, but in SQLAlchemy I can't seem to force the system to use the set timestamp.
Do I have no choice and need to update the MySQL table (millions of rows)?
foo = session.query(f).get(int(1))
ts = foo.timestamp
setattr(foo, 'timestamp', ts)
setattr(foo, 'bar', bar)
www_model.www_Session.commit()
I have also tried:
foo = session.query(f).get(int(1))
setattr(foo, 'timestamp', foo.timestamp)
setattr(foo, 'bar', bar)
www_model.www_Session.commit()