fix(automations): use enum values not names for postgres enum columns

This commit is contained in:
CREDO23 2026-05-27 21:53:07 +02:00
parent 27ab367a13
commit 8fb65d7188
3 changed files with 15 additions and 3 deletions

View file

@ -29,7 +29,11 @@ class AutomationTrigger(BaseModel, TimestampMixin):
)
type = Column(
SQLAlchemyEnum(TriggerType, name="automation_trigger_type"),
SQLAlchemyEnum(
TriggerType,
name="automation_trigger_type",
values_callable=lambda x: [e.value for e in x],
),
nullable=False,
index=True,
)