Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125106
128.sql
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
609 B
Subscribers
None
128.sql
View Options
-- SWH DB schema upgrade
-- from_version: 127
-- to_version: 128
-- description: Add snapshot trigger event on insertion
insert
into
dbversion
(
version
,
release
,
description
)
values
(
128
,
now
(),
'Work In Progress'
);
-- Asynchronous notification of new snapshot insertions
create
function
notify_new_snapshot
()
returns
trigger
language
plpgsql
as
$$
begin
perform
pg_notify
(
'new_snapshot'
,
json_build_object
(
'id'
,
encode
(
new
.
id
,
'hex'
))::
text
);
return
null
;
end
;
$$
;
create
trigger
notify_new_snapshot
after
insert
on
snapshot
for
each
row
execute
procedure
notify_new_snapshot
();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 21, 8:04 PM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3291814
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment