From f4a53bd8f0007a578bb6507b07c92527e1ead995 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 12 May 2020 09:57:31 +1000 Subject: [PATCH] DEV: create missing indexes These indexes should have been created in aa2a9da4 --- .../20200429095034_add_topic_thumbnail_information.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/migrate/20200429095034_add_topic_thumbnail_information.rb b/db/migrate/20200429095034_add_topic_thumbnail_information.rb index ee48265c6d8..2902d7730d9 100644 --- a/db/migrate/20200429095034_add_topic_thumbnail_information.rb +++ b/db/migrate/20200429095034_add_topic_thumbnail_information.rb @@ -16,6 +16,16 @@ class AddTopicThumbnailInformation < ActiveRecord::Migration[6.0] ADD COLUMN IF NOT EXISTS image_upload_id bigint SQL + execute <<~SQL + CREATE INDEX CONCURRENTLY IF NOT EXISTS + index_posts_on_image_upload_id ON posts USING btree (image_upload_id); + SQL + + execute <<~SQL + CREATE INDEX CONCURRENTLY IF NOT EXISTS + index_topics_on_image_upload_id ON public.topics USING btree (image_upload_id); + SQL + ActiveRecord::Base.transaction do add_column :theme_modifier_sets, :topic_thumbnail_sizes, :string, array: true