Changeset View
Standalone View
swh/indexer/sql/60-swh-indexes.sql
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
create unique index content_fossology_license_pkey on content_fossology_license(id, license_id, indexer_configuration_id); | create unique index content_fossology_license_pkey on content_fossology_license(id, license_id, indexer_configuration_id); | ||||
alter table content_fossology_license add primary key using index content_fossology_license_pkey; | alter table content_fossology_license add primary key using index content_fossology_license_pkey; | ||||
alter table content_fossology_license add constraint content_fossology_license_license_id_fkey foreign key (license_id) references fossology_license(id) not valid; | alter table content_fossology_license add constraint content_fossology_license_license_id_fkey foreign key (license_id) references fossology_license(id) not valid; | ||||
alter table content_fossology_license validate constraint content_fossology_license_license_id_fkey; | alter table content_fossology_license validate constraint content_fossology_license_license_id_fkey; | ||||
alter table content_fossology_license add constraint content_fossology_license_indexer_configuration_id_fkey foreign key (indexer_configuration_id) references indexer_configuration(id) not valid; | alter table content_fossology_license add constraint content_fossology_license_indexer_configuration_id_fkey foreign key (indexer_configuration_id) references indexer_configuration(id) not valid; | ||||
alter table content_fossology_license validate constraint content_fossology_license_indexer_configuration_id_fkey; | alter table content_fossology_license validate constraint content_fossology_license_indexer_configuration_id_fkey; | ||||
-- origin_intrinsic_metadata | |||||
moranegg: The PK is <origin_id, tool_id> in this diff.
Is that what you decided to go with?
I thought it… | |||||
Done Inline Actions
Yes
We didn't actually decide upon it. I figured there's no harm in making it into the PK, in case we want to progressively switch to a new tool with a different format someday. vlorentz: > Is that what you decided to go with?
Yes
> I thought it was only origin_id, but maybe… | |||||
Not Done Inline ActionsIf you remove that key pair, we can no longer have multiple values for 1 origin (1 value per origin and tool). ardumont: If you remove that key pair, we can no longer have multiple values for 1 origin (1 value per… | |||||
Not Done Inline Actions
You may not have discussed it but that was part of the initial design (or at least, it came to be at some point ;)
Actually, you must, that's part of the indexer stack ;)
Indeed, that's an example. ardumont: > We didn't actually decide upon it.
You may not have discussed it but that was part of the… | |||||
Not Done Inline ActionsYes but for the origin_intrinsic_metadata the question is more delicate because the tool referenced and used is the one used with the RevisionIndexer moranegg: Yes but for the origin_intrinsic_metadata the question is more delicate because the tool… | |||||
create unique index origin_intrinsic_metadata_pkey on origin_intrinsic_metadata(origin_id, indexer_configuration_id); | |||||
alter table origin_intrinsic_metadata add primary key using index origin_intrinsic_metadata_pkey; | |||||
alter table origin_intrinsic_metadata add constraint origin_intrinsic_metadata_indexer_configuration_id_fkey foreign key (indexer_configuration_id) references indexer_configuration(id) not valid; | |||||
alter table origin_intrinsic_metadata validate constraint origin_intrinsic_metadata_indexer_configuration_id_fkey; | |||||
alter table origin_intrinsic_metadata add constraint origin_intrinsic_metadata_revision_metadata_fkey foreign key (from_revision, indexer_configuration_id) references revision_metadata(id, indexer_configuration_id) not valid; | |||||
alter table origin_intrinsic_metadata validate constraint origin_intrinsic_metadata_revision_metadata_fkey; |
The PK is <origin_id, tool_id> in this diff.
Is that what you decided to go with?
I thought it was only origin_id, but maybe it's not a good choice.