Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/sql/30-swh-schema.sql
create table dbversion | create table dbversion | ||||
( | ( | ||||
version int primary key, | version int primary key, | ||||
release timestamptz not null, | release timestamptz not null, | ||||
description text not null | description text not null | ||||
); | ); | ||||
comment on table dbversion is 'Schema update tracking'; | comment on table dbversion is 'Schema update tracking'; | ||||
zack: SQL | |||||
comment on column dbversion.version is 'SQL schema version'; | |||||
Done Inline Actionsnot release, but deployment vlorentz: not release, but deployment | |||||
comment on column dbversion.release is 'Version deployment timestamp'; | |||||
comment on column dbversion.description is 'Version description'; | |||||
insert into dbversion (version, release, description) | insert into dbversion (version, release, description) | ||||
values (12, now(), 'Work In Progress'); | values (13, now(), 'Work In Progress'); | ||||
Done Inline ActionsMust be changed to 13. vlorentz: Must be changed to 13. | |||||
create table task_type ( | create table task_type ( | ||||
type text primary key, | type text primary key, | ||||
description text not null, | description text not null, | ||||
backend_name text not null, | backend_name text not null, | ||||
default_interval interval, | default_interval interval, | ||||
min_interval interval, | min_interval interval, | ||||
max_interval interval, | max_interval interval, | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | comment on column task.arguments is 'Arguments passed to the underlying job scheduler. ' | ||||
'Contains two keys, ''args'' (list) and ''kwargs'' (object).'; | 'Contains two keys, ''args'' (list) and ''kwargs'' (object).'; | ||||
comment on column task.next_run is 'The next run of this task should be run on or after that time'; | comment on column task.next_run is 'The next run of this task should be run on or after that time'; | ||||
comment on column task.current_interval is 'The interval between two runs of this task, ' | comment on column task.current_interval is 'The interval between two runs of this task, ' | ||||
'taking into account the backoff factor'; | 'taking into account the backoff factor'; | ||||
comment on column task.policy is 'Whether the task is one-shot or recurring'; | comment on column task.policy is 'Whether the task is one-shot or recurring'; | ||||
comment on column task.retries_left is 'The number of "short delay" retries of the task in case of ' | comment on column task.retries_left is 'The number of "short delay" retries of the task in case of ' | ||||
'transient failure'; | 'transient failure'; | ||||
comment on column task.priority is 'Policy of the given task'; | comment on column task.priority is 'Policy of the given task'; | ||||
comment on column task.id is 'Task Identifier'; | |||||
comment on column task.type is 'References task_type table'; | |||||
Done Inline ActionsAll possible statuses should be listed vlorentz: All possible statuses should be listed | |||||
comment on column task.status is 'Task status (''next_run_not_scheduled'', ''next_run_scheduled'', ''completed'', ''disabled'')'; | |||||
create type task_run_status as enum ('scheduled', 'started', 'eventful', 'uneventful', 'failed', 'permfailed', 'lost'); | create type task_run_status as enum ('scheduled', 'started', 'eventful', 'uneventful', 'failed', 'permfailed', 'lost'); | ||||
comment on type task_run_status is 'Status of a given task run'; | comment on type task_run_status is 'Status of a given task run'; | ||||
create table task_run ( | create table task_run ( | ||||
id bigserial primary key, | id bigserial primary key, | ||||
task bigint not null references task(id), | task bigint not null references task(id), | ||||
backend_id text, | backend_id text, | ||||
scheduled timestamptz, | scheduled timestamptz, | ||||
started timestamptz, | started timestamptz, | ||||
ended timestamptz, | ended timestamptz, | ||||
metadata jsonb, | metadata jsonb, | ||||
status task_run_status not null default 'scheduled' | status task_run_status not null default 'scheduled' | ||||
); | ); | ||||
comment on table task_run is 'History of task runs sent to the job-running backend'; | comment on table task_run is 'History of task runs sent to the job-running backend'; | ||||
comment on column task_run.backend_id is 'id of the task run in the job-running backend'; | comment on column task_run.backend_id is 'id of the task run in the job-running backend'; | ||||
comment on column task_run.metadata is 'Useful metadata for the given task run. ' | comment on column task_run.metadata is 'Useful metadata for the given task run. ' | ||||
'For instance, the worker that took on the job, ' | 'For instance, the worker that took on the job, ' | ||||
'or the logs for the run.'; | 'or the logs for the run.'; | ||||
comment on column task_run.id is 'Task run identifier'; | |||||
comment on column task_run.task is 'References task table'; | |||||
comment on column task_run.scheduled is 'Scheduled run time for task'; | |||||
comment on column task_run.started is 'Task starting time'; | |||||
comment on column task_run.ended is 'Task ending time'; | |||||
SQL