fix: fix custom email triggers enabled (#7164)

This commit is contained in:
Ruben Fiszel
2025-11-17 22:26:47 +00:00
committed by GitHub
parent 2a0bd52876
commit 9e897dd693
4 changed files with 6 additions and 1 deletions
@@ -0,0 +1 @@
-- Add down migration script here
@@ -0,0 +1,3 @@
-- Add up migration script here
ALTER TABLE email_trigger ADD COLUMN enabled BOOLEAN DEFAULT TRUE NOT NULL;
@@ -28,7 +28,7 @@ impl TriggerCrud for EmailTrigger {
const TABLE_NAME: &'static str = "";
const TRIGGER_TYPE: &'static str = "";
const SUPPORTS_ENABLED: bool = false;
const SUPPORTS_ENABLED: bool = true;
const SUPPORTS_SERVER_STATE: bool = false;
const SUPPORTS_TEST_CONNECTION: bool = false;
const ROUTE_PREFIX: &'static str = "/email_triggers";
@@ -366,6 +366,7 @@ pub trait TriggerCrud: Send + Sync + 'static {
.sql()
.map_err(|e| Error::InternalErr(format!("SQL error: {}", e)))?;
tracing::info!("SQL: {}", sql);
let triggers = sqlx::query_as(&sql).fetch_all(&mut *tx).await?;
Ok(triggers)