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(151, now(), 'Work In Progress'); | values(152, 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 All 13 Lines | |||||
-- stored in the DB, but on external (key-value) storage. A single checksum is | -- stored in the DB, but on external (key-value) storage. A single checksum is | ||||
-- used as key there, but the other can be used to verify that we do not inject | -- used as key there, but the other can be used to verify that we do not inject | ||||
-- content collisions not knowingly. | -- content collisions not knowingly. | ||||
create table content | create table content | ||||
( | ( | ||||
sha1 sha1 not null, | sha1 sha1 not null, | ||||
sha1_git sha1_git not null, | sha1_git sha1_git not null, | ||||
sha256 sha256 not null, | sha256 sha256 not null, | ||||
blake2s256 blake2s256, | blake2s256 blake2s256 not null, | ||||
length bigint not null, | length bigint not null, | ||||
ctime timestamptz not null default now(), | ctime timestamptz not null default now(), | ||||
-- creation time, i.e. time of (first) injection into the storage | -- creation time, i.e. time of (first) injection into the storage | ||||
status content_status not null default 'visible', | status content_status not null default 'visible', | ||||
object_id bigserial | object_id bigserial | ||||
); | ); | ||||
comment on table content is 'Checksums of file content which is actually stored externally'; | comment on table content is 'Checksums of file content which is actually stored externally'; | ||||
▲ Show 20 Lines • Show All 431 Lines • Show Last 20 Lines |