mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
21 lines
605 B
Python
21 lines
605 B
Python
|
from redash.models import db
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
db.connect_db()
|
||
|
columns = (
|
||
|
('activity_log', 'created_at'),
|
||
|
('dashboards', 'created_at'),
|
||
|
('data_sources', 'created_at'),
|
||
|
('events', 'created_at'),
|
||
|
('groups', 'created_at'),
|
||
|
('queries', 'created_at'),
|
||
|
('widgets', 'created_at'),
|
||
|
('query_results', 'retrieved_at')
|
||
|
)
|
||
|
|
||
|
with db.database.transaction():
|
||
|
for column in columns:
|
||
|
db.database.execute_sql("ALTER TABLE {} ALTER COLUMN {} TYPE timestamp with time zone;".format(*column))
|
||
|
|
||
|
db.close_db(None)
|