mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
fix(automations): use enum values not names for postgres enum columns
This commit is contained in:
parent
27ab367a13
commit
8fb65d7188
3 changed files with 15 additions and 3 deletions
|
|
@ -42,7 +42,11 @@ class Automation(BaseModel, TimestampMixin):
|
||||||
description = Column(Text, nullable=True)
|
description = Column(Text, nullable=True)
|
||||||
|
|
||||||
status = Column(
|
status = Column(
|
||||||
SQLAlchemyEnum(AutomationStatus, name="automation_status"),
|
SQLAlchemyEnum(
|
||||||
|
AutomationStatus,
|
||||||
|
name="automation_status",
|
||||||
|
values_callable=lambda x: [e.value for e in x],
|
||||||
|
),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=AutomationStatus.ACTIVE,
|
default=AutomationStatus.ACTIVE,
|
||||||
server_default=AutomationStatus.ACTIVE.value,
|
server_default=AutomationStatus.ACTIVE.value,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,11 @@ class AutomationRun(BaseModel, TimestampMixin):
|
||||||
)
|
)
|
||||||
|
|
||||||
status = Column(
|
status = Column(
|
||||||
SQLAlchemyEnum(RunStatus, name="automation_run_status"),
|
SQLAlchemyEnum(
|
||||||
|
RunStatus,
|
||||||
|
name="automation_run_status",
|
||||||
|
values_callable=lambda x: [e.value for e in x],
|
||||||
|
),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=RunStatus.PENDING,
|
default=RunStatus.PENDING,
|
||||||
server_default=RunStatus.PENDING.value,
|
server_default=RunStatus.PENDING.value,
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,11 @@ class AutomationTrigger(BaseModel, TimestampMixin):
|
||||||
)
|
)
|
||||||
|
|
||||||
type = Column(
|
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,
|
nullable=False,
|
||||||
index=True,
|
index=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue