mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-13 02:14:32 +01:00
Fix indexes
This commit is contained in:
parent
c7eb5fed35
commit
46524e4298
3 changed files with 11 additions and 6 deletions
|
@ -5,7 +5,7 @@ CREATE INDEX IF NOT EXISTS "sponsorTimes_hashedIP"
|
||||||
("hashedIP" COLLATE pg_catalog."default" ASC NULLS LAST)
|
("hashedIP" COLLATE pg_catalog."default" ASC NULLS LAST)
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
|
||||||
CREATE INDEX "privateDB_sponsorTimes_videoID"
|
CREATE INDEX IF NOT EXISTS "privateDB_sponsorTimes_videoID"
|
||||||
ON public."sponsorTimes" USING btree
|
ON public."sponsorTimes" USING btree
|
||||||
("videoID" ASC NULLS LAST)
|
("videoID" ASC NULLS LAST)
|
||||||
;
|
;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
-- sponsorTimes
|
-- sponsorTimes
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS "sponsorTiems_timeSubmitted"
|
CREATE INDEX IF NOT EXISTS "sponsorTime_timeSubmitted"
|
||||||
ON public."sponsorTimes" USING btree
|
ON public."sponsorTimes" USING btree
|
||||||
("timeSubmitted" ASC NULLS LAST)
|
("timeSubmitted" ASC NULLS LAST)
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
@ -14,8 +14,8 @@ CREATE INDEX IF NOT EXISTS "sponsorTimes_UUID"
|
||||||
ON public."sponsorTimes" USING btree
|
ON public."sponsorTimes" USING btree
|
||||||
("UUID" COLLATE pg_catalog."default" ASC NULLS LAST)
|
("UUID" COLLATE pg_catalog."default" ASC NULLS LAST)
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
|
||||||
CREATE INDEX "sponsorTimes_hashedVideoID_gin"
|
CREATE INDEX IF NOT EXISTS "sponsorTimes_hashedVideoID_gin"
|
||||||
ON public."sponsorTimes" USING gin
|
ON public."sponsorTimes" USING gin
|
||||||
("hashedVideoID" COLLATE pg_catalog."default" gin_trgm_ops, category COLLATE pg_catalog."default" gin_trgm_ops)
|
("hashedVideoID" COLLATE pg_catalog."default" gin_trgm_ops, category COLLATE pg_catalog."default" gin_trgm_ops)
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
@ -41,7 +41,7 @@ CREATE INDEX IF NOT EXISTS "vipUsers_index"
|
||||||
|
|
||||||
-- warnings
|
-- warnings
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS warnings_index
|
CREATE INDEX IF NOT EXISTS "warnings_index"
|
||||||
ON public.warnings USING btree
|
ON public.warnings USING btree
|
||||||
("userID" COLLATE pg_catalog."default" ASC NULLS LAST, "issueTime" DESC NULLS LAST, enabled DESC NULLS LAST)
|
("userID" COLLATE pg_catalog."default" ASC NULLS LAST, "issueTime" DESC NULLS LAST, enabled DESC NULLS LAST)
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
|
|
@ -24,7 +24,12 @@ export class Postgres implements IDatabase {
|
||||||
// Upgrade database if required
|
// Upgrade database if required
|
||||||
await this.upgradeDB(this.config.fileNamePrefix, this.config.dbSchemaFolder);
|
await this.upgradeDB(this.config.fileNamePrefix, this.config.dbSchemaFolder);
|
||||||
|
|
||||||
await this.applyIndexes(this.config.fileNamePrefix, this.config.dbSchemaFolder);
|
try {
|
||||||
|
await this.applyIndexes(this.config.fileNamePrefix, this.config.dbSchemaFolder);
|
||||||
|
} catch (e) {
|
||||||
|
Logger.warn("Applying indexes failed. See https://github.com/ajayyy/SponsorBlockServer/wiki/Postgres-Extensions for more information.");
|
||||||
|
Logger.warn(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue