feat(automation): wire SQLAlchemy relationships on both sides

This commit is contained in:
CREDO23 2026-05-27 13:45:32 +02:00
parent 7ac99b89a0
commit 7f4c1c25ab
4 changed files with 60 additions and 0 deletions

View file

@ -10,6 +10,7 @@ from sqlalchemy import (
Integer,
)
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import relationship
from app.db import BaseModel, TimestampMixin
@ -55,3 +56,6 @@ class AutomationRun(BaseModel, TimestampMixin):
started_at = Column(TIMESTAMP(timezone=True), nullable=True)
finished_at = Column(TIMESTAMP(timezone=True), nullable=True)
automation = relationship("Automation", back_populates="runs")
trigger = relationship("AutomationTrigger", back_populates="runs")