- Add storing bot response messages in postgres

- Add scheduled task to clean up said store
This commit is contained in:
dev-kittens
2020-10-18 00:18:52 -05:00
parent 9282d5e9fb
commit 05cc30279a
6 changed files with 52 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
-- SCHEMA VERSION 11: (insert date) --
-- Create command message table --
create table command_message
(
message_id bigint primary key,
invoker_id bigint not null,
timestamp timestamp not null default now()
);
create function cleanup_command_message() returns void as $$
begin
delete from command_message where timestamp < now() - interval '1 minute';
end;
$$ language plpgsql;
update info set schema_version = 11;