Changeset View
Changeset View
Standalone View
Standalone View
sql/swh-vault-schema.sql
Show All 25 Lines | create table vault_bundle ( | ||||
task_status cook_status not null default 'new', -- status of the task | task_status cook_status not null default 'new', -- status of the task | ||||
sticky boolean not null default false, -- bundle cannot expire | sticky boolean not null default false, -- bundle cannot expire | ||||
ts_created timestamptz not null default now(), -- timestamp of creation | ts_created timestamptz not null default now(), -- timestamp of creation | ||||
ts_done timestamptz, -- timestamp of the cooking result | ts_done timestamptz, -- timestamp of the cooking result | ||||
ts_last_access timestamptz not null default now(), -- last access | ts_last_access timestamptz not null default now(), -- last access | ||||
progress_msg text, -- progress message | progress_msg text, -- progress message | ||||
unique(type, object_id) | |||||
); | ); | ||||
create unique index concurrently vault_bundle_type_object | |||||
on vault_bundle (type, object_id); | |||||
create index concurrently vault_bundle_task_id | |||||
on vault_bundle (task_id); | |||||
create table vault_notif_email ( | create table vault_notif_email ( | ||||
id bigserial primary key, | id bigserial primary key, | ||||
email text not null, -- e-mail to notify | email text not null, -- e-mail to notify | ||||
bundle_id bigint not null references vault_bundle(id) | bundle_id bigint not null references vault_bundle(id) | ||||
); | ); | ||||
create index concurrently vault_notif_email_bundle | |||||
on vault_notif_email (bundle_id); | |||||
create index concurrently vault_notif_email_email | |||||
on vault_notif_email (email); | |||||
create table vault_batch ( | |||||
id bigserial primary key | |||||
); | |||||
create table vault_batch_bundle ( | |||||
batch_id bigint not null references vault_batch(id), | |||||
bundle_id bigint not null references vault_bundle(id) | |||||
); | |||||
create unique index concurrently vault_batch_bundle_pkey | |||||
on vault_batch_bundle (batch_id, bundle_id); |