Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/sql/30-swh-schema.sql
Show All 11 Lines | |||||
comment on table dbversion is 'Details of current db version'; | comment on table dbversion is 'Details of current db version'; | ||||
comment on column dbversion.version is 'SQL schema version'; | comment on column dbversion.version is 'SQL schema version'; | ||||
comment on column dbversion.release is 'Version deployment timestamp'; | comment on column dbversion.release is 'Version deployment timestamp'; | ||||
comment on column dbversion.description is 'Release description'; | comment on column dbversion.description is 'Release description'; | ||||
-- latest schema version | -- latest schema version | ||||
insert into dbversion(version, release, description) | insert into dbversion(version, release, description) | ||||
values(140, now(), 'Work In Progress'); | values(141, now(), 'Work In Progress'); | ||||
-- a SHA1 checksum | -- a SHA1 checksum | ||||
create domain sha1 as bytea check (length(value) = 20); | create domain sha1 as bytea check (length(value) = 20); | ||||
-- a Git object ID, i.e., a Git-style salted SHA1 checksum | -- a Git object ID, i.e., a Git-style salted SHA1 checksum | ||||
create domain sha1_git as bytea check (length(value) = 20); | create domain sha1_git as bytea check (length(value) = 20); | ||||
-- a SHA256 checksum | -- a SHA256 checksum | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
comment on column skipped_content.length is 'Skipped content length'; | comment on column skipped_content.length is 'Skipped content length'; | ||||
comment on column skipped_content.ctime is 'First seen time'; | comment on column skipped_content.ctime is 'First seen time'; | ||||
comment on column skipped_content.status is 'Skipped content status (absent, visible, hidden)'; | comment on column skipped_content.status is 'Skipped content status (absent, visible, hidden)'; | ||||
comment on column skipped_content.reason is 'Reason for skipping'; | comment on column skipped_content.reason is 'Reason for skipping'; | ||||
comment on column skipped_content.origin is 'Origin table identifier'; | comment on column skipped_content.origin is 'Origin table identifier'; | ||||
comment on column skipped_content.object_id is 'Skipped content identifier'; | comment on column skipped_content.object_id is 'Skipped content identifier'; | ||||
-- Log of all origin fetches (i.e., origin crawling) that have been done in the | |||||
-- past, or are still ongoing. Similar to list_history, but for origins. | |||||
create table fetch_history | |||||
( | |||||
id bigserial, | |||||
origin bigint, | |||||
date timestamptz not null, | |||||
status boolean, -- true if and only if the fetch has been successful | |||||
result jsonb, -- more detailed returned values, times, etc... | |||||
stdout text, | |||||
stderr text, -- null when status is true, filled otherwise | |||||
duration interval -- fetch duration of NULL if still ongoing | |||||
); | |||||
comment on table fetch_history is 'Log of all origin fetches'; | |||||
comment on column fetch_history.id is 'Identifier for fetch history'; | |||||
comment on column fetch_history.origin is 'Origin table identifier'; | |||||
comment on column fetch_history.date is 'Fetch start time'; | |||||
comment on column fetch_history.status is 'True indicates successful fetch'; | |||||
comment on column fetch_history.result is 'Detailed return values, times etc'; | |||||
comment on column fetch_history.stdout is 'Standard output of fetch operation'; | |||||
comment on column fetch_history.stderr is 'Standard error of fetch operation'; | |||||
comment on column fetch_history.duration is 'Time taken to complete fetch, NULL if ongoing'; | |||||
-- A file-system directory. A directory is a list of directory entries (see | -- A file-system directory. A directory is a list of directory entries (see | ||||
-- tables: directory_entry_{dir,file}). | -- tables: directory_entry_{dir,file}). | ||||
-- | -- | ||||
-- To list the contents of a directory: | -- To list the contents of a directory: | ||||
-- 1. list the contained directory_entry_dir using array dir_entries | -- 1. list the contained directory_entry_dir using array dir_entries | ||||
-- 2. list the contained directory_entry_file using array file_entries | -- 2. list the contained directory_entry_file using array file_entries | ||||
-- 3. list the contained directory_entry_rev using array rev_entries | -- 3. list the contained directory_entry_rev using array rev_entries | ||||
-- 4. UNION | -- 4. UNION | ||||
▲ Show 20 Lines • Show All 342 Lines • Show Last 20 Lines |