diff --git a/databases/_sponsorTimes_indexes.sql b/databases/_sponsorTimes_indexes.sql index 212b0ab4..f707a1f5 100644 --- a/databases/_sponsorTimes_indexes.sql +++ b/databases/_sponsorTimes_indexes.sql @@ -134,9 +134,9 @@ CREATE INDEX IF NOT EXISTS "titles_videoID" ("videoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default; -CREATE INDEX IF NOT EXISTS "titles_hashedVideoID" +CREATE INDEX IF NOT EXISTS "titles_hashedVideoID_2" ON public."titles" USING btree - ("hashedVideoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST) + (service COLLATE pg_catalog."default" ASC NULLS LAST, "hashedVideoID" text_pattern_ops ASC NULLS LAST, "timeSubmitted" ASC NULLS LAST) TABLESPACE pg_default; -- titleVotes @@ -163,9 +163,9 @@ CREATE INDEX IF NOT EXISTS "thumbnails_videoID" ("videoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default; -CREATE INDEX IF NOT EXISTS "thumbnails_hashedVideoID" +CREATE INDEX IF NOT EXISTS "thumbnails_hashedVideoID_2" ON public."thumbnails" USING btree - ("hashedVideoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST) + (service COLLATE pg_catalog."default" ASC NULLS LAST, "hashedVideoID" text_pattern_ops ASC NULLS LAST, "timeSubmitted" ASC NULLS LAST) TABLESPACE pg_default; -- thumbnailVotes diff --git a/databases/_upgrade_sponsorTimes_40.sql b/databases/_upgrade_sponsorTimes_40.sql new file mode 100644 index 00000000..481a8a73 --- /dev/null +++ b/databases/_upgrade_sponsorTimes_40.sql @@ -0,0 +1,8 @@ +BEGIN TRANSACTION; + +DROP INDEX IF EXISTS "titles_hashedVideoID"; +DROP INDEX IF EXISTS "thumbnails_hashedVideoID"; + +UPDATE "config" SET value = 40 WHERE key = 'version'; + +COMMIT;