Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/sql/30-swh-schema.sql
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | create table content_metadata( | ||||
indexer_configuration_id bigint not null | indexer_configuration_id bigint not null | ||||
); | ); | ||||
comment on table content_metadata is 'metadata semantically translated from a content file'; | comment on table content_metadata is 'metadata semantically translated from a content file'; | ||||
comment on column content_metadata.id is 'sha1 of content file'; | comment on column content_metadata.id is 'sha1 of content file'; | ||||
comment on column content_metadata.translated_metadata is 'result of translation with defined format'; | comment on column content_metadata.translated_metadata is 'result of translation with defined format'; | ||||
comment on column content_metadata.indexer_configuration_id is 'tool used for translation'; | comment on column content_metadata.indexer_configuration_id is 'tool used for translation'; | ||||
-- The table revision_metadata provides a minimal set of intrinsic metadata | -- The table revision_intrinsic_metadata provides a minimal set of intrinsic | ||||
-- detected with the detection tool (indexer_configuration_id) and aggregated | -- metadata detected with the detection tool (indexer_configuration_id) and | ||||
-- from the content_metadata translation. | -- aggregated from the content_metadata translation. | ||||
create table revision_metadata( | create table revision_intrinsic_metadata( | ||||
id sha1_git not null, | id sha1_git not null, | ||||
translated_metadata jsonb not null, | metadata jsonb not null, | ||||
indexer_configuration_id bigint not null, | indexer_configuration_id bigint not null, | ||||
mappings text array not null | mappings text array not null | ||||
); | ); | ||||
comment on table revision_metadata is 'metadata semantically detected and translated in a revision'; | comment on table revision_intrinsic_metadata is 'metadata semantically detected and translated in a revision'; | ||||
comment on column revision_metadata.id is 'sha1_git of revision'; | comment on column revision_intrinsic_metadata.id is 'sha1_git of revision'; | ||||
comment on column revision_metadata.translated_metadata is 'result of detection and translation with defined format'; | comment on column revision_intrinsic_metadata.metadata is 'result of detection and translation with defined format'; | ||||
comment on column revision_metadata.indexer_configuration_id is 'tool used for detection'; | comment on column revision_intrinsic_metadata.indexer_configuration_id is 'tool used for detection'; | ||||
comment on column revision_metadata.mappings is 'type of metadata files used to obtain this metadata (eg. pkg-info, npm)'; | comment on column revision_intrinsic_metadata.mappings is 'type of metadata files used to obtain this metadata (eg. pkg-info, npm)'; | ||||
create table origin_intrinsic_metadata( | create table origin_intrinsic_metadata( | ||||
origin_id bigserial not null, | id bigserial not null, | ||||
metadata jsonb, | metadata jsonb, | ||||
indexer_configuration_id bigint not null, | indexer_configuration_id bigint not null, | ||||
from_revision sha1_git not null, | from_revision sha1_git not null, | ||||
metadata_tsvector tsvector, | metadata_tsvector tsvector, | ||||
mappings text array not null | mappings text array not null | ||||
); | ); | ||||
comment on table origin_intrinsic_metadata is 'keeps intrinsic metadata for an origin'; | comment on table origin_intrinsic_metadata is 'keeps intrinsic metadata for an origin'; | ||||
comment on column origin_intrinsic_metadata.origin_id is 'the entry id in origin'; | comment on column origin_intrinsic_metadata.id is 'the entry id in origin'; | ||||
comment on column origin_intrinsic_metadata.metadata is 'metadata extracted from a revision'; | comment on column origin_intrinsic_metadata.metadata is 'metadata extracted from a revision'; | ||||
comment on column origin_intrinsic_metadata.indexer_configuration_id is 'tool used to generate this metadata'; | comment on column origin_intrinsic_metadata.indexer_configuration_id is 'tool used to generate this metadata'; | ||||
comment on column origin_intrinsic_metadata.from_revision is 'sha1 of the revision this metadata was copied from.'; | comment on column origin_intrinsic_metadata.from_revision is 'sha1 of the revision this metadata was copied from.'; | ||||
comment on column origin_intrinsic_metadata.mappings is 'type of metadata files used to obtain this metadata (eg. pkg-info, npm)'; | comment on column origin_intrinsic_metadata.mappings is 'type of metadata files used to obtain this metadata (eg. pkg-info, npm)'; |