From b2305c0f1276fd343c877607913dbdd7261b756f Mon Sep 17 00:00:00 2001 From: gr-dv Date: Thu, 12 Oct 2023 12:55:22 +0300 Subject: [PATCH] MSP-2243 add migration: bgjob --- migrations/20231012125431_bgjob.sql | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 migrations/20231012125431_bgjob.sql diff --git a/migrations/20231012125431_bgjob.sql b/migrations/20231012125431_bgjob.sql new file mode 100644 index 0000000..8d2f3d2 --- /dev/null +++ b/migrations/20231012125431_bgjob.sql @@ -0,0 +1,32 @@ +-- +goose Up +create table bgjob_job +( + id text primary key, + queue text not null, + type text not null, + arg bytea, + attempt int4 not null, + last_error text, + next_run_at int8 not null, + created_at timestamp not null, + updated_at timestamp not null +); + +create index ix_bgjob_job__queue_next_run_at_created_at on bgjob_job (queue, next_run_at, created_at); + +create table bgjob_dead_job +( + id serial8 primary key, + job_id text not null, + queue text not null, + type text not null, + arg bytea, + attempt int4 not null, + last_error text not null, + next_run_at int8 not null, + job_created_at timestamp not null, + job_updated_at timestamp not null, + moved_at timestamp not null +); + +-- +goose Down