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(141, now(), 'Work In Progress'); | values(142, 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 42 Lines • ▼ Show 20 Lines | |||||
-- other VCS repositories, web pages that list tarballs URLs (e.g., | -- other VCS repositories, web pages that list tarballs URLs (e.g., | ||||
-- http://www.kernel.org), indirect tarball URLs (e.g., | -- http://www.kernel.org), indirect tarball URLs (e.g., | ||||
-- http://www.example.org/latest.tar.gz), etc. The key feature of an origin is | -- http://www.example.org/latest.tar.gz), etc. The key feature of an origin is | ||||
-- that it can be *fetched* from (wget, git clone, svn checkout, etc.) to | -- that it can be *fetched* from (wget, git clone, svn checkout, etc.) to | ||||
-- retrieve all the contained software. | -- retrieve all the contained software. | ||||
create table origin | create table origin | ||||
( | ( | ||||
id bigserial not null, | id bigserial not null, | ||||
type text, -- TODO use an enum here (?) | |||||
url text not null | url text not null | ||||
); | ); | ||||
comment on column origin.id is 'Artifact origin id'; | comment on column origin.id is 'Artifact origin id'; | ||||
comment on column origin.type is 'Type of origin'; | |||||
comment on column origin.url is 'URL of origin'; | comment on column origin.url is 'URL of origin'; | ||||
-- Content blobs observed somewhere, but not ingested into the archive for | -- Content blobs observed somewhere, but not ingested into the archive for | ||||
-- whatever reason. This table is separate from the content table as we might | -- whatever reason. This table is separate from the content table as we might | ||||
-- not have the sha1 checksum of skipped contents (for instance when we inject | -- not have the sha1 checksum of skipped contents (for instance when we inject | ||||
-- git repositories, objects that are too big will be skipped here, and we will | -- git repositories, objects that are too big will be skipped here, and we will | ||||
-- only know their sha1_git). 'reason' contains the reason the content was | -- only know their sha1_git). 'reason' contains the reason the content was | ||||
▲ Show 20 Lines • Show All 379 Lines • Show Last 20 Lines |