Skip to content

Commit

Permalink
fix(workflow): update updated_at default to use UTC timezone (langgen…
Browse files Browse the repository at this point in the history
…ius#11960)

Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 authored Dec 22, 2024
1 parent 6b49889 commit 750662e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/models/workflow.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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="{}"
Expand Down

0 comments on commit 750662e

Please sign in to comment.