mirror of
https://github.com/immich-app/immich.git
synced 2026-06-30 10:07:09 -07:00
953ef5c047
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
103 lines
2.5 KiB
SQL
103 lines
2.5 KiB
SQL
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
-- WorkflowRepository.search
|
|
select
|
|
"workflow"."id",
|
|
"workflow"."name",
|
|
"workflow"."description",
|
|
"workflow"."trigger",
|
|
"workflow"."enabled",
|
|
"workflow"."createdAt",
|
|
"workflow"."updatedAt",
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"plugin"."name" as "pluginName",
|
|
"plugin_method"."name" as "methodName",
|
|
"workflow_step"."config",
|
|
"workflow_step"."enabled"
|
|
from
|
|
"workflow_step"
|
|
inner join "plugin_method" on "plugin_method"."id" = "workflow_step"."pluginMethodId"
|
|
inner join "plugin" on "plugin"."id" = "plugin_method"."pluginId"
|
|
where
|
|
"workflow"."id" = "workflow_step"."workflowId"
|
|
) as agg
|
|
) as "steps"
|
|
from
|
|
"workflow"
|
|
order by
|
|
"createdAt" desc
|
|
|
|
-- WorkflowRepository.get
|
|
select
|
|
"workflow"."id",
|
|
"workflow"."name",
|
|
"workflow"."description",
|
|
"workflow"."trigger",
|
|
"workflow"."enabled",
|
|
"workflow"."createdAt",
|
|
"workflow"."updatedAt",
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"plugin"."name" as "pluginName",
|
|
"plugin_method"."name" as "methodName",
|
|
"workflow_step"."config",
|
|
"workflow_step"."enabled"
|
|
from
|
|
"workflow_step"
|
|
inner join "plugin_method" on "plugin_method"."id" = "workflow_step"."pluginMethodId"
|
|
inner join "plugin" on "plugin"."id" = "plugin_method"."pluginId"
|
|
where
|
|
"workflow"."id" = "workflow_step"."workflowId"
|
|
) as agg
|
|
) as "steps"
|
|
from
|
|
"workflow"
|
|
where
|
|
"id" = $1
|
|
|
|
-- WorkflowRepository.getForWorkflowRun
|
|
select
|
|
"workflow"."id",
|
|
"workflow"."name",
|
|
"workflow"."trigger",
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"workflow_step"."id",
|
|
"workflow_step"."config",
|
|
"plugin_method"."pluginId" as "pluginId",
|
|
"plugin_method"."name" as "methodName",
|
|
"plugin_method"."types" as "types",
|
|
"plugin_method"."hostFunctions",
|
|
"plugin_method"."allowedHosts"
|
|
from
|
|
"workflow_step"
|
|
inner join "plugin_method" on "plugin_method"."id" = "workflow_step"."pluginMethodId"
|
|
where
|
|
"workflow_step"."workflowId" = "workflow"."id"
|
|
and "workflow_step"."enabled" = $1
|
|
) as agg
|
|
) as "steps"
|
|
from
|
|
"workflow"
|
|
where
|
|
"id" = $2
|
|
and "enabled" = $3
|
|
|
|
-- WorkflowRepository.delete
|
|
delete from "workflow"
|
|
where
|
|
"id" = $1
|