Skip to content

Commit ea83fe8

Browse files
committed
Use path in the update_full_url function.
1 parent cc74bb5 commit ea83fe8

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
alter table public.endpoints
2-
add column path text;
2+
add column path text;
3+
4+
create or replace function update_full_url(p_service_id integer)
5+
returns void
6+
security definer
7+
language plpgsql
8+
as
9+
$$
10+
begin
11+
update public.endpoints e
12+
set full_url = concat(s.base_url, e.path)
13+
from public.services s
14+
where s.id = p_service_id and e.service_id = s.id;
15+
end;
16+
$$;

0 commit comments

Comments
 (0)