From 90b800ced73ce6757d0296efc7f945ceff787289 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 10 Apr 2022 00:07:15 -0500 Subject: [PATCH] tags: add index on is_deprecated. --- ...0220410050628_add_is_deprecated_index_on_tags.rb | 5 +++++ db/structure.sql | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20220410050628_add_is_deprecated_index_on_tags.rb diff --git a/db/migrate/20220410050628_add_is_deprecated_index_on_tags.rb b/db/migrate/20220410050628_add_is_deprecated_index_on_tags.rb new file mode 100644 index 000000000..95a49a5df --- /dev/null +++ b/db/migrate/20220410050628_add_is_deprecated_index_on_tags.rb @@ -0,0 +1,5 @@ +class AddIsDeprecatedIndexOnTags < ActiveRecord::Migration[7.0] + def change + add_index :tags, :is_deprecated, where: "is_deprecated = TRUE" + end +end diff --git a/db/structure.sql b/db/structure.sql index 181769d4b..688dfb05d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1882,7 +1882,8 @@ CREATE TABLE public.tags ( category integer DEFAULT 0 NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, - is_locked boolean DEFAULT false NOT NULL + is_locked boolean DEFAULT false NOT NULL, + is_deprecated boolean DEFAULT false NOT NULL ); @@ -4505,6 +4506,13 @@ CREATE INDEX index_tag_implications_on_consequent_name ON public.tag_implication CREATE INDEX index_tag_implications_on_forum_post_id ON public.tag_implications USING btree (forum_post_id); +-- +-- Name: index_tags_on_is_deprecated; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_tags_on_is_deprecated ON public.tags USING btree (is_deprecated) WHERE (is_deprecated = true); + + -- -- Name: index_tags_on_name; Type: INDEX; Schema: public; Owner: - -- @@ -5797,6 +5805,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20220318082614'), ('20220403042706'), ('20220403220558'), -('20220407203236'); +('20220407203236'), +('20220410050628');