Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Add unique indices to catalog (#306)

Madison Swain-Bowdenab90e8ee610c
diff --git a/docker/local_postgres/0003_openledger_image_schema.sql b/docker/local_postgres/0003_openledger_image_schema.sql
index 94b8d6616..69c3275d8 100644
--- a/docker/local_postgres/0003_openledger_image_schema.sql
+++ b/docker/local_postgres/0003_openledger_image_schema.sql
@@ -44,5 +44,11 @@ CREATE TABLE public.image (
ALTER TABLE public.image OWNER TO deploy;
CREATE UNIQUE INDEX image_provider_fid_idx
- ON public.image
- USING btree (provider, md5(foreign_identifier));
+ ON public.image
+ USING btree (provider, md5(foreign_identifier));
+CREATE UNIQUE INDEX image_identifier_key
+ ON public.image
+ USING btree (identifier);
+CREATE UNIQUE INDEX image_url_key
+ ON public.image
+ USING btree (url);
diff --git a/docker/local_postgres/0006_openledger_audio_schema.sql b/docker/local_postgres/0006_openledger_audio_schema.sql
index 35850b15b..b547b1d30 100644
--- a/docker/local_postgres/0006_openledger_audio_schema.sql
+++ b/docker/local_postgres/0006_openledger_audio_schema.sql
@@ -50,5 +50,11 @@ CREATE TABLE public.audio (
ALTER TABLE public.audio OWNER TO deploy;
CREATE UNIQUE INDEX audio_provider_fid_idx
- ON public.audio
- USING btree (provider, md5(foreign_identifier));
+ ON public.audio
+ USING btree (provider, md5(foreign_identifier));
+CREATE UNIQUE INDEX audio_identifier_key
+ ON public.audio
+ USING btree (identifier);
+CREATE UNIQUE INDEX audio_url_key
+ ON public.audio
+ USING btree (url);