Refactor command message deletion
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
-- SCHEMA VERSION 11: (insert date) --
|
||||
-- SCHEMA VERSION 11: 2020-10-23 --
|
||||
-- Create command message table --
|
||||
|
||||
create table command_message
|
||||
create table command_messages
|
||||
(
|
||||
message_id bigint primary key,
|
||||
author_id bigint not null,
|
||||
timestamp timestamp not null default now()
|
||||
message_id bigint primary key not null,
|
||||
author_id bigint not null
|
||||
);
|
||||
|
||||
create function cleanup_command_message() returns void as $$
|
||||
begin
|
||||
delete from command_message where timestamp < now() - interval '2 hours';
|
||||
end;
|
||||
$$ language plpgsql;
|
||||
|
||||
update info set schema_version = 11;
|
||||
|
Reference in New Issue
Block a user