fix: use default_factory for callable defaults in ORM dataclasses (#28730)

This commit is contained in:
-LAN- authored and GitHub committed 2025-11-27 09:39:49 +09:00
1 parent 4ccc150fd1
commit 38522e5dfa
12 files changed
+269 -76

No files matched your search

+3 -1
View File
@@ -1103,7 +1103,9 @@ class WorkflowAppLog(TypeBase):
sa.Index("workflow_app_log_workflow_run_id_idx", "workflow_run_id"),
)
id: Mapped[str] = mapped_column(StringUUID, default=lambda: str(uuid4()), init=False)
id: Mapped[str] = mapped_column(
StringUUID, insert_default=lambda: str(uuid4()), default_factory=lambda: str(uuid4()), init=False
)
tenant_id: Mapped[str] = mapped_column(StringUUID)
app_id: Mapped[str] = mapped_column(StringUUID)
workflow_id: Mapped[str] = mapped_column(StringUUID, nullable=False)