Changeset View
Changeset View
Standalone View
Standalone View
sql/archiver/swh-archiver-schema.sql
Show All 24 Lines | |||||
comment on table archive is 'Possible archives'; | comment on table archive is 'Possible archives'; | ||||
comment on column archive.id is 'Short identifier for the archive'; | comment on column archive.id is 'Short identifier for the archive'; | ||||
comment on column archive.url is 'Url identifying the archiver api'; | comment on column archive.url is 'Url identifying the archiver api'; | ||||
CREATE TYPE archive_status AS ENUM ( | CREATE TYPE archive_status AS ENUM ( | ||||
'missing', | 'missing', | ||||
'ongoing', | 'ongoing', | ||||
'present' | 'present', | ||||
'corrupted' | |||||
); | ); | ||||
comment on type archive_status is 'Status of a given archive'; | comment on type archive_status is 'Status of a given archive'; | ||||
-- a SHA1 checksum (not necessarily originating from Git) | -- a SHA1 checksum (not necessarily originating from Git) | ||||
CREATE DOMAIN sha1 AS bytea CHECK (LENGTH(VALUE) = 20); | CREATE DOMAIN sha1 AS bytea CHECK (LENGTH(VALUE) = 20); | ||||
CREATE TABLE content_archive ( | CREATE TABLE content_archive ( | ||||
content_id sha1 unique, | content_id sha1 unique, | ||||
copies jsonb | copies jsonb | ||||
); | ); | ||||
comment on table content_archive is 'Referencing the status and whereabouts of a content'; | comment on table content_archive is 'Referencing the status and whereabouts of a content'; | ||||
comment on column content_archive.content_id is 'content identifier'; | comment on column content_archive.content_id is 'content identifier'; | ||||
comment on column content_archive.copies is 'map archive_id -> { "status": archive_status, "mtime": epoch timestamp }' | comment on column content_archive.copies is 'map archive_id -> { "status": archive_status, "mtime": epoch timestamp }' |