cubicweb/misc/migration/3.22.0_Any.py
author Laurent Peuch <cortex@worlddomination.be>
Tue, 17 Dec 2019 16:56:23 +0100
changeset 12820 da416fb21657
parent 11129 97095348b3ee
permissions -rw-r--r--
[test/fix] prevent FirefoxHelper from silently failing to start This was breaking some tests without any obvious error message and you should fail as early as possible to make debugging easier. Closes #17260390

if confirm('use Europe/Paris as timezone?'):
    timezone = 'Europe/Paris'
else:
    import pytz
    while True:
        timezone = raw_input('enter your timezone')
        if timezone in pytz.common_timezones:
            break

dbdriver = repo.system_source.dbdriver
if dbdriver == 'postgres':
    sql("SET TIME ZONE '%s'" % timezone)

for entity in schema.entities():
    if entity.final or entity.type not in fsschema:
        continue
    change_attribute_type(entity.type, 'creation_date', 'TZDatetime', ask_confirm=False)
    change_attribute_type(entity.type, 'modification_date', 'TZDatetime', ask_confirm=False)

if dbdriver == 'postgres':
    sql("SET TIME ZONE UTC")