mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 07:32:32 -04:00
3d075f2bf8
feat: plugins chore: better types feat: plugins
102 lines
2.5 KiB
SQL
102 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"
|
|
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
|