Changeset View
Changeset View
Standalone View
Standalone View
swh/scrubber/sql/60-indexes.sql
------------------------------------- | ------------------------------------- | ||||
-- Shared tables | -- Shared tables | ||||
------------------------------------- | ------------------------------------- | ||||
-- datastore | -- datastore | ||||
create unique index concurrently datastore_pkey on datastore(id); | create unique index concurrently datastore_pkey on datastore(id); | ||||
alter table datastore add primary key using index datastore_pkey; | alter table datastore add primary key using index datastore_pkey; | ||||
create unique index concurrently datastore_package_class_instance on datastore(package, class, instance); | create unique index concurrently datastore_package_class_instance on datastore(package, class, instance); | ||||
------------------------------------- | |||||
-- Checkpointing/progress tracking | |||||
------------------------------------- | |||||
create unique index concurrently checked_range_pkey on checked_range(datastore, range_start, range_end); | |||||
alter table checked_range add primary key using index checked_range_pkey; | |||||
------------------------------------- | ------------------------------------- | ||||
-- Inventory of objects with issues | -- Inventory of objects with issues | ||||
------------------------------------- | ------------------------------------- | ||||
-- corrupt_object | -- corrupt_object | ||||
alter table corrupt_object add constraint corrupt_object_datastore_fkey foreign key (datastore) references datastore(id) not valid; | alter table corrupt_object add constraint corrupt_object_datastore_fkey foreign key (datastore) references datastore(id) not valid; | ||||
Show All 40 Lines |