File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # This file is part of Invenio.
3+ # Copyright (C) 2025 CERN.
4+ # Copyright (C) 2026 Graz University of Technology.
5+ #
6+ # Invenio is free software; you can redistribute it and/or modify it
7+ # under the terms of the MIT License; see LICENSE file for more details.
8+
9+ """Alter datetime columns to utc aware datetime columns."""
10+
11+ from invenio_db .utils import (
12+ update_table_columns_column_type_to_datetime ,
13+ update_table_columns_column_type_to_utc_datetime ,
14+ )
15+
16+ # revision identifiers, used by Alembic.
17+ revision = "3ca07f2ee12b"
18+ down_revision = "74b23178bfbe"
19+ branch_labels = ()
20+ depends_on = None
21+
22+
23+ def upgrade ():
24+ """Upgrade database."""
25+ for table_name in ["request_files" ]:
26+ update_table_columns_column_type_to_utc_datetime (table_name , "created" )
27+ update_table_columns_column_type_to_utc_datetime (table_name , "updated" )
28+
29+
30+ def downgrade ():
31+ """Downgrade database."""
32+ for table_name in ["request_files" ]:
33+ update_table_columns_column_type_to_datetime (table_name , "created" )
34+ update_table_columns_column_type_to_datetime (table_name , "updated" )
You can’t perform that action at this time.
0 commit comments