[schema synchronization] don't use sql for TODAY/NOW in keyword arg. Closes #2154815
Also consider TZDatetime on the way
--- a/hooks/syncschema.py Mon Jan 23 12:36:33 2012 +0100
+++ b/hooks/syncschema.py Thu Jan 19 18:44:41 2012 +0100
@@ -487,13 +487,17 @@
# set default value, using sql for performance and to avoid
# modification_date update
if default:
- if rdefdef.object in ('Date', 'Datetime'):
+ if rdefdef.object in ('Date', 'Datetime', 'TZDatetime'):
+ # XXX may may want to use creation_date
if default == 'TODAY':
default = syssource.dbhelper.sql_current_date()
elif default == 'NOW':
default = syssource.dbhelper.sql_current_timestamp()
- session.system_sql('UPDATE %s SET %s=%%(default)s' % (table, column),
- {'default': default})
+ session.system_sql('UPDATE %s SET %s=%(default)s'
+ % (table, column, default))
+ else:
+ session.system_sql('UPDATE %s SET %s=%%(default)s' % (table, column),
+ {'default': default})
def revertprecommit_event(self):
# revert changes on in memory schema