From f72ac23755adaec71264940967f2f95d23f915e5 Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 10 Jan 2022 21:20:51 +0100 Subject: [PATCH] db fix indexes --- migrations/046-removal-indexes.sql | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 migrations/046-removal-indexes.sql diff --git a/migrations/046-removal-indexes.sql b/migrations/046-removal-indexes.sql new file mode 100644 index 00000000..e2ffd285 --- /dev/null +++ b/migrations/046-removal-indexes.sql @@ -0,0 +1,36 @@ +-- Up + +CREATE UNIQUE INDEX "users_username" ON "users" ("username"); +CREATE UNIQUE INDEX "users_email" ON "users" ("email"); + +CREATE UNIQUE INDEX "users_usernameNorm" ON "users" ("usernameNorm"); +CREATE INDEX "authenticators_type" ON "authenticators" ("type"); +CREATE INDEX "authenticators_userId" ON "authenticators" ("userId"); +CREATE INDEX "census_locale_edition" ON "census" ("locale", "edition"); +CREATE INDEX "census_fingerprint" ON "census" ("fingerprint"); +CREATE INDEX "emails_email" ON "emails" ("email"); +CREATE INDEX "nouns_locale" ON "nouns" ("locale"); +CREATE INDEX "nouns_masc" ON "nouns" ("masc"); +CREATE INDEX "inclusive_locale" ON "inclusive" ("locale"); +CREATE INDEX "inclusive_insteadOf" ON "inclusive" ("insteadOf"); +CREATE INDEX "terms_locale" ON "terms" ("locale"); +CREATE INDEX "terms_term" ON "terms" ("term"); +CREATE INDEX "profiles_locale" ON "profiles" ("locale"); +CREATE INDEX "profiles_userId" ON "profiles" ("userId"); +CREATE INDEX "profiles_locale_userId" ON "profiles" ("locale", "userId"); +CREATE INDEX "sources_locale" ON "sources" ("locale"); + +CREATE INDEX "reports_isAutomatic" ON "reports" ("isAutomatic"); +CREATE INDEX "reports_isHandled" ON "reports" ("isHandled"); + +CREATE INDEX "names_name_locale" ON "names" ("locale", "name"); +CREATE INDEX "names_name" ON "names" ("name"); +CREATE INDEX "names_locale" ON "names" ("locale"); + +CREATE INDEX "profiles_teamName" ON "profiles" ("teamName"); +CREATE INDEX "profiles_footerName" ON "profiles" ("footerName"); +CREATE INDEX "profiles_footerAreas" ON "profiles" ("footerAreas"); +CREATE INDEX "reports_userId" ON "reports" ("userId"); + +-- Down +