add table responses; + (work in progress) JSON table

This commit is contained in:
Helmut Merz 2022-11-20 12:45:02 +01:00
parent abf870d291
commit 843c080901
2 changed files with 19 additions and 1 deletions

View file

@ -12,8 +12,20 @@ CREATE TABLE messages (
tstamp timestamptz default current_timestamp
);
CREATE TABLE responses (
id bigserial NOT NULL primary key,
domain text,
action text,
class text,
item text,
payload jsonb,
tstamp timestamptz default current_timestamp
);
-- indexes
CREATE INDEX idx_msg ON messages USING btree (domain, action, class, item);
CREATE INDEX idx_msg_item ON messages USING btree (domain, class, item);
CREATE INDEX idx_msg_action ON messages USING btree (action);
--CREATE INDEX idx_msg_action ON messages USING btree (action); -- obsolete
CREATE INDEX idx_resp_item ON responses USING btree (domain, class, item);

View file

@ -0,0 +1,6 @@
-- temporary table for loading JSON data
CREATE TABLE tmp_json (
id bigserial NOT NULL primary key,
data jsonb
);