Created
September 20, 2023 20:48
-
-
Save gifflet/10b93332432d26a528125420314f9d83 to your computer and use it in GitHub Desktop.
db-scheduler SQL init script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table scheduled_tasks ( | |
task_name text not null, | |
task_instance text not null, | |
task_data bytea, | |
execution_time timestamp with time zone not null, | |
picked BOOLEAN not null, | |
picked_by text, | |
last_success timestamp with time zone, | |
last_failure timestamp with time zone, | |
consecutive_failures INT, | |
last_heartbeat timestamp with time zone, | |
version BIGINT not null, | |
PRIMARY KEY (task_name, task_instance) | |
); | |
CREATE INDEX execution_time_idx ON scheduled_tasks (execution_time); | |
CREATE INDEX last_heartbeat_idx ON scheduled_tasks (last_heartbeat); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment