Files
bodyshop/hasura/migrations/1596730747611_run_sql_migration/up.yaml

15 lines
614 B
YAML

- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.parts_status_by_job_id(jobid uuid)\n RETURNS
SETOF joblines\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if jobid
= '' then\n return query select status ,count(1), part_type from joblines
j group by status, part_type ;\n else \n return query select status ,count(1),
part_type from joblines j where j.jobid =jobid group by status, part_type;\n
\ end if;\n\n\tEND\n$function$;"
type: run_sql
- args:
name: parts_status_by_job_id
schema: public
type: track_function