fix repeatable migrations
This commit is contained in:
15
db/routines/R__026_fn_modbus_commands_by_ids.sql
Normal file
15
db/routines/R__026_fn_modbus_commands_by_ids.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
create or replace function ems.fn_modbus_commands_by_ids(p_ids int[])
|
||||
returns jsonb
|
||||
language sql
|
||||
stable
|
||||
as $fn$
|
||||
select coalesce(
|
||||
jsonb_agg(to_jsonb(m.*) order by m.id),
|
||||
'[]'::jsonb
|
||||
)
|
||||
from ems.modbus_command m
|
||||
where m.id = any(p_ids);
|
||||
$fn$;
|
||||
|
||||
comment on function ems.fn_modbus_commands_by_ids(int[]) is
|
||||
'Řádky modbus_command pro seznam ID (ověření / journal detail).';
|
||||
Reference in New Issue
Block a user