Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ license = "GPL-2.0"
requires-python = ">=3.9"
dependencies = [
# Pin invenio-requests until we release the final commenting features
"invenio-app-rdm[opensearch2]==14.0.0b4.dev6",
"invenio-app-rdm[opensearch2]==14.0.0b5.dev3",
"invenio-cern-sync",
"invenio-preservation-sync==0.2.0",
"invenio-preservation-sync==0.3.0",
"cds-rdm",
"lxml>=4.6.5",
"s3fs>=2024.6.1", # extra of invenio-vocabularies for ORCiD dump
Expand All @@ -21,17 +21,7 @@ dependencies = [

[tool.uv.sources]
cds-rdm = { workspace = true }
invenio-cern-sync = { git = "https://github.com/cerndocumentserver/invenio-cern-sync", rev = "v0.5.0"}

[tool.uv]
override-dependencies = [
# The old version of invenio-files-rest we are using (before we upgrade to invenio-app-rdm 14.0.0b5.*) depends on `fs`
# which is unmaintained and depends on `setuptools`. A new major version of `setuptools` (81/82) is allowed by
# `fs` despite breaking it completely. For now, we are adding a dependency override to the last known working version.
"setuptools>=80.0.0,<81.0.0",
# Pin invenio-requests until we release the final commenting features
"invenio-requests<11.3.0"
]
invenio-cern-sync = { git = "https://github.com/cerndocumentserver/invenio-cern-sync", rev = "v0.6.0" }

[tool.uv.workspace]
members = [
Expand Down
33 changes: 33 additions & 0 deletions site/cds_rdm/alembic/1771314900_change_datetime_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# This file is part of Invenio.
# Copyright (C) 2026 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""change datetime types."""

from invenio_db.utils import (
update_table_columns_column_type_to_datetime,
update_table_columns_column_type_to_utc_datetime,
)

# revision identifiers, used by Alembic.
revision = "1771314900"
down_revision = "1746783030"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
update_table_columns_column_type_to_utc_datetime("cds_clc_record_sync", "last_sync")
update_table_columns_column_type_to_utc_datetime("cds_clc_record_sync", "created")
update_table_columns_column_type_to_utc_datetime("cds_clc_record_sync", "updated")


def downgrade():
"""Downgrade database."""
update_table_columns_column_type_to_datetime("cds_clc_record_sync", "last_sync")
update_table_columns_column_type_to_datetime("cds_clc_record_sync", "created")
update_table_columns_column_type_to_datetime("cds_clc_record_sync", "updated")
10 changes: 5 additions & 5 deletions site/cds_rdm/clc_sync/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# CDS-RDM is free software; you can redistribute it and/or modify it
# under the terms of the GPL-2.0 License; see LICENSE file for more details.
"""CDS Migration models."""

import enum
import uuid
from datetime import datetime
from datetime import datetime, timezone

from invenio_db import db
from invenio_records.models import Timestamp
from invenio_db.shared import Timestamp, UTCDateTime
from sqlalchemy import Column, String, UniqueConstraint, or_
from sqlalchemy.dialects import mysql
from sqlalchemy_utils import ChoiceType
from sqlalchemy_utils.types import UUIDType

Expand Down Expand Up @@ -69,8 +69,8 @@ class CDSToCLCSyncModel(db.Model, Timestamp):
)

last_sync = db.Column(
db.DateTime().with_variant(mysql.DATETIME(fsp=6), "mysql"),
default=datetime.utcnow,
UTCDateTime(),
default=datetime.now(tz=timezone.utc),
nullable=True,
comment="Last sync time",
)
Expand Down
Loading
Loading