Changeset View
Changeset View
Standalone View
Standalone View
sql/upgrades/129.sql
- This file was added.
-- SWH DB schema upgrade | |||||
-- from_version: 128 | |||||
-- to_version: 129 | |||||
-- description: Update origin trigger to provide the full origin | |||||
insert into dbversion(version, release, description) | |||||
values(129, now(), 'Work In Progress'); | |||||
-- Asynchronous notification of new origin insertions | |||||
create or replace function notify_new_origin() | |||||
returns trigger | |||||
language plpgsql | |||||
as $$ | |||||
begin | |||||
perform pg_notify('new_origin', json_build_object( | |||||
'url', new.url::text, | |||||
ardumont: Wondering if we need to keep the id. I think not.
| |||||
Done Inline ActionsLet's remove it. It won't (or shouldn't be) part of the output of pgsql. vlorentz: Let's remove it. It won't (or shouldn't be) part of the output of pgsql. | |||||
'type', new.type::text | |||||
)::text); | |||||
return null; | |||||
end; | |||||
$$; | |||||
drop trigger notify_new_origin on origin; | |||||
create trigger notify_new_origin | |||||
after insert on origin | |||||
for each row | |||||
execute procedure notify_new_origin(); |
Wondering if we need to keep the id. I think not.