feat: route bounded hierarchy postbox copies
This commit is contained in:
@@ -641,8 +641,20 @@ class PostboxDelivery(Base, TimestampMixin):
|
||||
class PostboxRoute(Base, TimestampMixin):
|
||||
__tablename__ = "postbox_routes"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"delivery_id",
|
||||
"target_postbox_id",
|
||||
"route_kind",
|
||||
"depth",
|
||||
name="uq_postbox_routes_delivery_target_kind_depth",
|
||||
),
|
||||
Index("ix_postbox_routes_delivery_kind", "delivery_id", "route_kind"),
|
||||
Index("ix_postbox_routes_target", "tenant_id", "target_postbox_id"),
|
||||
Index(
|
||||
"ix_postbox_routes_due",
|
||||
"status",
|
||||
"execute_after",
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=new_uuid)
|
||||
@@ -676,6 +688,14 @@ class PostboxRoute(Base, TimestampMixin):
|
||||
ForeignKey("postbox_routes.id", ondelete="SET NULL"),
|
||||
nullable=True,
|
||||
)
|
||||
execute_after: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
nullable=True,
|
||||
)
|
||||
processed_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
nullable=True,
|
||||
)
|
||||
policy_snapshot: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON,
|
||||
default=dict,
|
||||
|
||||
Reference in New Issue
Block a user