Skip to content

Commit 1d8b37b

Browse files
committed
fix: add missing alembic script
* the comment file has been added after the change to UTCDateTime column
1 parent bcbf67f commit 1d8b37b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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")

0 commit comments

Comments
 (0)