sync update from LAN repo (source ji @ 85078a31)
This commit is contained in:
1 parent
5d6627af50
commit
e602d88695
864 files changed
+99150
-6346
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
"""ORM row for the global, database-backed upload policy."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from sqlalchemy import Integer, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from deerflow.persistence.base import Base
|
||||
from deerflow.persistence.types import BeijingDateTime, PortableJSON
|
||||
|
||||
|
||||
class UploadPolicyRow(Base):
|
||||
__tablename__ = "upload_policy"
|
||||
|
||||
# A named singleton keeps the schema extensible if scoped policies are
|
||||
# introduced later without requiring a table redesign.
|
||||
scope: Mapped[str] = mapped_column(String(64), primary_key=True, default="global")
|
||||
policy_json: Mapped[dict] = mapped_column(PortableJSON(), default=dict)
|
||||
revision: Mapped[int] = mapped_column(Integer, default=1, server_default="1")
|
||||
updated_by: Mapped[str | None] = mapped_column(String(64))
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
BeijingDateTime(), default=lambda: datetime.now(UTC), onupdate=lambda: datetime.now(UTC)
|
||||
)
|
||||
Reference in new issue
Block a user