Changeset View
Changeset View
Standalone View
Standalone View
sql/swh-indexes.sql
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
create index concurrently on occurrence_history(target, target_type); | create index concurrently on occurrence_history(target, target_type); | ||||
create index concurrently on occurrence_history(origin, branch); | create index concurrently on occurrence_history(origin, branch); | ||||
create unique index concurrently on occurrence_history(origin, branch, target, target_type); | create unique index concurrently on occurrence_history(origin, branch, target, target_type); | ||||
alter table occurrence_history add constraint occurrence_history_origin_fkey foreign key (origin) references origin(id) not valid; | alter table occurrence_history add constraint occurrence_history_origin_fkey foreign key (origin) references origin(id) not valid; | ||||
alter table occurrence_history validate constraint occurrence_history_origin_fkey; | alter table occurrence_history validate constraint occurrence_history_origin_fkey; | ||||
-- occurrence | |||||
create unique index concurrently occurrence_pkey on occurrence(origin, branch); | |||||
alter table occurrence add primary key using index occurrence_pkey; | |||||
alter table occurrence add constraint occurrence_origin_fkey foreign key (origin) references origin(id) not valid; | |||||
alter table occurrence validate constraint occurrence_origin_fkey; | |||||
-- release | -- release | ||||
create unique index concurrently release_pkey on release(id); | create unique index concurrently release_pkey on release(id); | ||||
alter table release add primary key using index release_pkey; | alter table release add primary key using index release_pkey; | ||||
create index concurrently on release(target, target_type); | create index concurrently on release(target, target_type); | ||||
create unique index concurrently on release(object_id); | create unique index concurrently on release(object_id); | ||||
alter table release add constraint release_author_fkey foreign key (author) references person(id) not valid; | alter table release add constraint release_author_fkey foreign key (author) references person(id) not valid; | ||||
Show All 36 Lines |