Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(workflow): update updated_at default to use UTC timezone (#11960)

-LAN-750662eb0867
diff --git a/api/models/workflow.py b/api/models/workflow.py
index 0e5cf38d25e..7896339f37d 100644
--- a/api/models/workflow.py
+++ b/api/models/workflow.py
@@ -1,6 +1,6 @@
import json
from collections.abc import Mapping, Sequence
-from datetime import datetime
+from datetime import UTC, datetime
from enum import Enum, StrEnum
from typing import Any, Optional, Union
@@ -106,7 +106,10 @@ class Workflow(db.Model):
created_at: Mapped[datetime] = mapped_column(db.DateTime, nullable=False, server_default=func.current_timestamp())
updated_by: Mapped[Optional[str]] = mapped_column(StringUUID)
updated_at: Mapped[datetime] = mapped_column(
- db.DateTime, nullable=False, server_default=func.current_timestamp(), server_onupdate=func.current_timestamp()
+ db.DateTime,
+ nullable=False,
+ default=datetime.now(UTC).replace(tzinfo=None),
+ server_onupdate=func.current_timestamp(),
)
_environment_variables: Mapped[str] = mapped_column(
"environment_variables", db.Text, nullable=False, server_default="{}"