Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/sql/30-schema.sql
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | |||||
); | ); | ||||
comment on table revision_history is 'Sequence of revision history with parent and position in history'; | comment on table revision_history is 'Sequence of revision history with parent and position in history'; | ||||
comment on column revision_history.id is 'Revision history git object sha1 checksum'; | comment on column revision_history.id is 'Revision history git object sha1 checksum'; | ||||
comment on column revision_history.parent_id is 'Parent revision git object identifier'; | comment on column revision_history.parent_id is 'Parent revision git object identifier'; | ||||
comment on column revision_history.parent_rank is 'Parent position in merge commits, 0-based'; | comment on column revision_history.parent_rank is 'Parent position in merge commits, 0-based'; | ||||
-- The ExtID (typ. original VCS) <-> swhid relation table | |||||
create table extid | |||||
( | |||||
extid_type text not null, | |||||
extid bytea not null, | |||||
olasd: We'll want to add an index (unique) on these columns. | |||||
target_type object_type not null, | |||||
target sha1_git not null | |||||
); | |||||
comment on table extid is 'Correspondance SWH object (SWHID) <-> original revision id (vcs id)'; | |||||
comment on column extid.extid_type is 'ExtID type'; | |||||
comment on column extid.extid is 'Intrinsic identifier of the object (e.g. hg revision)'; | |||||
comment on column extid.target_type is 'Type of SWHID of the referenced SWH object'; | |||||
comment on column extid.target is 'Value (hash) of SWHID of the refenced SWH object'; | |||||
-- Crawling history of software origins visited by Software Heritage. Each | -- Crawling history of software origins visited by Software Heritage. Each | ||||
-- visit is a 3-way mapping between a software origin, a timestamp, and a | -- visit is a 3-way mapping between a software origin, a timestamp, and a | ||||
-- snapshot object capturing the full-state of the origin at visit time. | -- snapshot object capturing the full-state of the origin at visit time. | ||||
create table origin_visit | create table origin_visit | ||||
( | ( | ||||
origin bigint not null, | origin bigint not null, | ||||
visit bigint not null, | visit bigint not null, | ||||
date timestamptz not null, | date timestamptz not null, | ||||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |
We'll want to add an index (unique) on these columns.