define a simple message store for integrator messages
This commit is contained in:
parent
21f093c60c
commit
645761410c
2 changed files with 24 additions and 0 deletions
3
pgsql/msgstore/drop.sql
Normal file
3
pgsql/msgstore/drop.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- drop tables
|
||||
|
||||
drop table messages;
|
||||
21
pgsql/msgstore/tcreate.sql
Normal file
21
pgsql/msgstore/tcreate.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
-- create tables
|
||||
|
||||
CREATE TABLE messages (
|
||||
id bigserial NOT NULL primary key,
|
||||
domain text,
|
||||
action text,
|
||||
class text,
|
||||
item text,
|
||||
sender text,
|
||||
payload jsonb,
|
||||
state smallint default 0,
|
||||
tstamp timestamptz default current_timestamp
|
||||
);
|
||||
|
||||
-- indexes
|
||||
|
||||
CREATE INDEX idx_msg ON messages USING btree (domain, action, class, item);
|
||||
CREATE INDEX idx_msg_action ON messages USING btree (action);
|
||||
CREATE INDEX idx_msg_state ON messages USING btree (state);
|
||||
CREATE INDEX idx_msg_tstamp ON messages USING btree (tstamp);
|
||||
Loading…
Add table
Reference in a new issue