-
Notifications
You must be signed in to change notification settings - Fork 248
/
0090.yml
51 lines (49 loc) · 1.57 KB
/
0090.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: 90
description: prepare queue for upcoming migration and refactoring
migrationScript: |-
begin
alter table azure_queue_messages
add column task_queue_id text null, -- expose cryptic names
add column priority int null; -- don't forget about the priority
end
downgradeScript: |-
begin
alter table azure_queue_messages
drop column task_queue_id,
drop column priority;
end
methods:
azure_queue_put:
deprecated: true
azure_queue_put_extra:
description: |
Put the given message into the given queue. The message will not be visible until
after the visible timestamp, and will disappear after the expires timestamp.
Additionally store the given task_queue_id and priority.
mode: write
serviceName: queue
args: queue_name text, message_text text, visible timestamp, expires timestamp, task_queue_id text, priority int
returns: void
body: |-
begin
insert into azure_queue_messages (
queue_name,
message_id,
message_text,
inserted,
visible,
expires,
task_queue_id,
priority
) values (
azure_queue_put_extra.queue_name,
public.gen_random_uuid(),
azure_queue_put_extra.message_text,
now(),
azure_queue_put_extra.visible,
azure_queue_put_extra.expires,
azure_queue_put_extra.task_queue_id,
azure_queue_put_extra.priority
);
execute 'notify ' || quote_ident(queue_name);
end