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(149, now(), 'Work In Progress'); | values(150, 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 383 Lines • ▼ Show 20 Lines | |||||
comment on column metadata_fetcher.metadata is 'Extra information about the fetcher'; | comment on column metadata_fetcher.metadata is 'Extra information about the fetcher'; | ||||
create table metadata_authority | create table metadata_authority | ||||
( | ( | ||||
id serial not null, | id serial not null, | ||||
type text not null, | type text not null, | ||||
url text not null, | url text not null, | ||||
metadata jsonb | metadata jsonb not null | ||||
vlorentz: I don't think there should be a default. https://docs.softwareheritage.org/devel/swh… | |||||
Done Inline ActionsOk, removing the default. We have some which are None already though. softwareheritage=> select * from metadata_authority where metadata is null; id | type | url | metadata -----+----------------+--------------------------+---------- 206 | deposit_client | https://www.ipol.im/ | 250 | deposit_client | https://doi.org/10.5201/ | ardumont: Ok, removing the default.
We have some which are None already though.
Is it fine to default it… | |||||
); | ); | ||||
comment on table metadata_authority is 'Metadata authority information'; | comment on table metadata_authority is 'Metadata authority information'; | ||||
comment on column metadata_authority.id is 'Internal identifier of the authority'; | comment on column metadata_authority.id is 'Internal identifier of the authority'; | ||||
comment on column metadata_authority.type is 'Type of authority (deposit/forge/registry)'; | comment on column metadata_authority.type is 'Type of authority (deposit/forge/registry)'; | ||||
comment on column metadata_authority.url is 'Authority''s uri'; | comment on column metadata_authority.url is 'Authority''s uri'; | ||||
comment on column metadata_authority.metadata is 'Other metadata about authority'; | comment on column metadata_authority.metadata is 'Other metadata about authority'; | ||||
-- Discovery of metadata during a listing, loading, deposit or external_catalog of an origin | -- Discovery of metadata during a listing, loading, deposit or external_catalog of an origin | ||||
-- also provides a translation to a defined json schema using a translation tool (tool_id) | -- also provides a translation to a defined json schema using a translation tool (tool_id) | ||||
create table origin_metadata | create table origin_metadata | ||||
( | ( | ||||
id bigserial not null, -- PK internal object identifier | id bigserial not null, -- PK internal object identifier | ||||
origin_id bigint not null, -- references origin(id) | origin_id bigint not null, -- references origin(id) | ||||
discovery_date timestamptz not null, -- when it was extracted | discovery_date timestamptz not null, -- when it was extracted | ||||
authority_id bigint not null, | authority_id bigint not null, | ||||
fetcher_id bigint not null, | fetcher_id bigint not null, | ||||
format text default 'sword-v2-atom-codemeta-v2-in-json', | format text not null default 'sword-v2-atom-codemeta-v2-in-json', | ||||
metadata bytea | metadata bytea not null | ||||
); | ); | ||||
comment on table origin_metadata is 'keeps all metadata found concerning an origin'; | comment on table origin_metadata is 'keeps all metadata found concerning an origin'; | ||||
comment on column origin_metadata.id is 'the origin_metadata object''s id'; | comment on column origin_metadata.id is 'the origin_metadata object''s id'; | ||||
comment on column origin_metadata.origin_id is 'the origin id for which the metadata was found'; | comment on column origin_metadata.origin_id is 'the origin id for which the metadata was found'; | ||||
comment on column origin_metadata.discovery_date is 'the date of retrieval'; | comment on column origin_metadata.discovery_date is 'the date of retrieval'; | ||||
comment on column origin_metadata.authority_id is 'the metadata provider: github, openhub, deposit, etc.'; | comment on column origin_metadata.authority_id is 'the metadata provider: github, openhub, deposit, etc.'; | ||||
comment on column origin_metadata.fetcher_id is 'the tool used for extracting metadata: loaders, crawlers, etc.'; | comment on column origin_metadata.fetcher_id is 'the tool used for extracting metadata: loaders, crawlers, etc.'; | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
I don't think there should be a default. https://docs.softwareheritage.org/devel/swh-storage/extrinsic-metadata-specification.html#authorities-and-metadata-fetchers doesn't allow None.