diff --git a/backend/alembic/versions/47433d30de82_create_indexattempt_table.py b/backend/alembic/versions/47433d30de82_create_indexattempt_table.py index 449b35b7d5c9..2319b2eb2b6f 100644 --- a/backend/alembic/versions/47433d30de82_create_indexattempt_table.py +++ b/backend/alembic/versions/47433d30de82_create_indexattempt_table.py @@ -47,6 +47,7 @@ def upgrade() -> None: sa.Column( "time_updated", sa.DateTime(timezone=True), + server_default=sa.text("now()"), server_onupdate=sa.text("now()"), # type: ignore nullable=True, ), diff --git a/backend/danswer/db/models.py b/backend/danswer/db/models.py index 80de5455b02a..1d9cda9de6dd 100644 --- a/backend/danswer/db/models.py +++ b/backend/danswer/db/models.py @@ -73,7 +73,7 @@ class IndexAttempt(Base): DateTime(timezone=True), server_default=func.now() ) time_updated: Mapped[datetime.datetime] = mapped_column( - DateTime(timezone=True), onupdate=func.now() + DateTime(timezone=True), server_default=func.now(), onupdate=func.now() ) status: Mapped[IndexingStatus] = mapped_column(Enum(IndexingStatus)) document_ids: Mapped[list[str] | None] = mapped_column(