-- NOTE: This file is auto generated by ./sql-generator

-- WorkflowRepository.getWorkflow
select
  *
from
  "workflow"
where
  "id" = $1
order by
  "createdAt" desc

-- WorkflowRepository.getWorkflowsByOwner
select
  *
from
  "workflow"
where
  "ownerId" = $1
order by
  "createdAt" desc

-- WorkflowRepository.getWorkflowsByTrigger
select
  *
from
  "workflow"
where
  "triggerType" = $1
  and "enabled" = $2

-- WorkflowRepository.getWorkflowByOwnerAndTrigger
select
  *
from
  "workflow"
where
  "ownerId" = $1
  and "triggerType" = $2
  and "enabled" = $3

-- WorkflowRepository.deleteWorkflow
delete from "workflow"
where
  "id" = $1

-- WorkflowRepository.getFilters
select
  *
from
  "workflow_filter"
where
  "workflowId" = $1
order by
  "order" asc

-- WorkflowRepository.deleteFiltersByWorkflow
delete from "workflow_filter"
where
  "workflowId" = $1

-- WorkflowRepository.getActions
select
  *
from
  "workflow_action"
where
  "workflowId" = $1
order by
  "order" asc
