misc/migration/3.22.0_Any.py
changeset 11033 63d860a14a17
child 11101 66fb68c25f83
equal deleted inserted replaced
11032:38afb7e23c6c 11033:63d860a14a17
       
     1 if confirm('use Europe/Paris as timezone?'):
       
     2     timezone = 'Europe/Paris'
       
     3 else:
       
     4     import pytz
       
     5     while True:
       
     6         timezone = raw_input('enter your timezone')
       
     7         if timezone in pytz.common_timezones:
       
     8             break
       
     9 
       
    10 dbdriver = repo.system_source.dbdriver
       
    11 if dbdriver == 'postgres':
       
    12     sql("SET TIME ZONE '%s'" % timezone)
       
    13 
       
    14 for entity in schema.entities():
       
    15     if entity.final:
       
    16         continue
       
    17     change_attribute_type(entity.type, 'creation_date', 'TZDatetime', ask_confirm=False)
       
    18     change_attribute_type(entity.type, 'modification_date', 'TZDatetime', ask_confirm=False)
       
    19 
       
    20 if dbdriver == 'postgres':
       
    21     sql("SET TIME ZONE UTC")