2020-10-18 05:18:52 +00:00
|
|
|
-- SCHEMA VERSION 11: (insert date) --
|
|
|
|
-- Create command message table --
|
|
|
|
|
|
|
|
create table command_message
|
|
|
|
(
|
|
|
|
message_id bigint primary key,
|
2020-10-18 05:59:36 +00:00
|
|
|
author_id bigint not null,
|
2020-10-18 05:18:52 +00:00
|
|
|
timestamp timestamp not null default now()
|
|
|
|
);
|
|
|
|
|
|
|
|
create function cleanup_command_message() returns void as $$
|
|
|
|
begin
|
2020-10-19 08:57:43 +00:00
|
|
|
delete from command_message where timestamp < now() - interval '2 hours';
|
2020-10-18 05:18:52 +00:00
|
|
|
end;
|
|
|
|
$$ language plpgsql;
|
|
|
|
|
2020-10-18 06:06:20 +00:00
|
|
|
update info set schema_version = 11;
|