about summary refs log tree commit diff
path: root/dist
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-18 03:30:52 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-18 03:30:52 -0600
commit158369f367a4a29eb960a7489939c5e13c33dc0b (patch)
treef322cc7ae0545bf0198115c816ba1355d52d70fd /dist
parentf1230bb319004e77cba2bf6419ae919d0c02b6c5 (diff)
Create `f_normalize` function to transform filter queries. Also make the FTS migration an actual migration to save new Monsterfork admins the headache.
Diffstat (limited to 'dist')
-rw-r--r--dist/search.sql21
1 files changed, 2 insertions, 19 deletions
diff --git a/dist/search.sql b/dist/search.sql
index e68b3c9b3..f80ca049c 100644
--- a/dist/search.sql
+++ b/dist/search.sql
@@ -1,22 +1,5 @@
--- Run this section on Mastodon DB as Postgres superuser. --
+-- Before running db:migrate, run this on Mastodon DB as Postgres superuser. --
 -- sudo -sHu postgres -- psql mastodon_production
 
 CREATE EXTENSION pg_trgm;
-
--- Run this section on Mastodon DB as Mastodon user. --
--- sudo -sHu mastodon -- psql mastodon_production
-
--- Drop old FTS implementation --
-DROP TRIGGER IF EXISTS tsvectorinsert ON statuses;
-DROP TRIGGER IF EXISTS tsvectorupdate ON statuses;
-DROP FUNCTION IF EXISTS tsv_update_trigger;
-DROP INDEX IF EXISTS tsv_idx;
-ALTER TABLE statuses DROP COLUMN IF EXISTS tsv;
-DROP INDEX IF EXISTS index_statuses_on_text_trgm;
-DROP INDEX IF EXISTS index_statuses_on_spoiler_text_trgm;
-
--- Create new trigram indexes --
-CREATE INDEX CONCURRENTLY IF NOT EXISTS index_statuses_on_normalized_text_trgm ON statuses USING GIN (normalized_text gin_trgm_ops);
-
--- Compact tables ---
-VACUUM ANALYZE;
+CREATE EXTENSION unaccent;