Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/sql/60-swh-indexes.sql
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||
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; | ||||
alter table release validate constraint release_author_fkey; | alter table release validate constraint release_author_fkey; | ||||
ardumont: from where does that rule come from?
I'm not against it, i'm not sure what that entails. | |||||
Done Inline ActionsIt comes from @olasd. I remember the rational is something along the lines of:
vlorentz: It comes from @olasd. I remember the rational is something along the lines of:
* author is… | |||||
-- if the author is null, then the date must be null | |||||
alter table release add constraint release_author_date_check check ((date is null) or (author is not null)) not valid; | |||||
alter table release validate constraint release_author_date_check; | |||||
-- tool | -- tool | ||||
create unique index tool_pkey on tool(id); | create unique index tool_pkey on tool(id); | ||||
alter table tool add primary key using index tool_pkey; | alter table tool add primary key using index tool_pkey; | ||||
create unique index on tool(name, version, configuration); | create unique index on tool(name, version, configuration); | ||||
-- metadata_provider | -- metadata_provider | ||||
create unique index concurrently metadata_provider_pkey on metadata_provider(id); | create unique index concurrently metadata_provider_pkey on metadata_provider(id); | ||||
Show All 26 Lines |
from where does that rule come from?
I'm not against it, i'm not sure what that entails.