db: remove unused tsvector triggers.

This was forgotten in 080dbf5a8.
This commit is contained in:
evazion
2022-01-06 19:49:22 -06:00
parent 0f3fc0d697
commit dbf4e1e98e
2 changed files with 21 additions and 44 deletions

View File

@@ -0,0 +1,19 @@
class DropTsvectorTriggers < ActiveRecord::Migration[6.1]
def up
execute "DROP TRIGGER trigger_comments_on_update ON comments"
execute "DROP TRIGGER trigger_dmails_on_update ON dmails"
execute "DROP TRIGGER trigger_forum_posts_on_update ON forum_posts"
execute "DROP TRIGGER trigger_forum_topics_on_update ON forum_topics"
execute "DROP TRIGGER trigger_notes_on_update ON notes"
execute "DROP TRIGGER trigger_wiki_pages_on_update ON wiki_pages"
end
def down
execute "CREATE TRIGGER trigger_comments_on_update BEFORE INSERT OR UPDATE ON public.comments FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body')"
execute "CREATE TRIGGER trigger_dmails_on_update BEFORE INSERT OR UPDATE ON public.dmails FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body')"
execute "CREATE TRIGGER trigger_forum_posts_on_update BEFORE INSERT OR UPDATE ON public.forum_posts FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('text_index', 'pg_catalog.english', 'body')"
execute "CREATE TRIGGER trigger_forum_topics_on_update BEFORE INSERT OR UPDATE ON public.forum_topics FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('text_index', 'pg_catalog.english', 'title')"
execute "CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON public.notes FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body')"
execute "CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON public.wiki_pages FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body', 'title')"
end
end

View File

@@ -890,7 +890,6 @@ CREATE TABLE public.posts (
bit_flags bigint DEFAULT 0 NOT NULL,
tag_count_meta integer DEFAULT 0 NOT NULL
);
ALTER TABLE ONLY public.posts ALTER COLUMN tag_index SET STATISTICS 3000;
--
@@ -4745,48 +4744,6 @@ CREATE INDEX index_wiki_pages_on_updated_at ON public.wiki_pages USING btree (up
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
--
-- Name: comments trigger_comments_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_comments_on_update BEFORE INSERT OR UPDATE ON public.comments FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body');
--
-- Name: dmails trigger_dmails_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_dmails_on_update BEFORE INSERT OR UPDATE ON public.dmails FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body');
--
-- Name: forum_posts trigger_forum_posts_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_forum_posts_on_update BEFORE INSERT OR UPDATE ON public.forum_posts FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('text_index', 'pg_catalog.english', 'body');
--
-- Name: forum_topics trigger_forum_topics_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_forum_topics_on_update BEFORE INSERT OR UPDATE ON public.forum_topics FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('text_index', 'pg_catalog.english', 'title');
--
-- Name: notes trigger_notes_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON public.notes FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body');
--
-- Name: wiki_pages trigger_wiki_pages_on_update; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON public.wiki_pages FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body', 'title');
--
-- PostgreSQL database dump complete
--
@@ -5054,6 +5011,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220101224048'),
('20220104214319'),
('20220106171727'),
('20220106172910');
('20220106172910'),
('20220107014433');