From 97de973eb2c7b80a56be10be011046da6f271801 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 30 Apr 2020 12:45:02 +1000 Subject: [PATCH] FIX: amend resetting of cache We need to reset the column info cache for posts so we can run the update --- db/migrate/20200226183018_create_calendar_events.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20200226183018_create_calendar_events.rb b/db/migrate/20200226183018_create_calendar_events.rb index 3261640e..d116ca77 100644 --- a/db/migrate/20200226183018_create_calendar_events.rb +++ b/db/migrate/20200226183018_create_calendar_events.rb @@ -33,9 +33,9 @@ class CreateCalendarEvents < ActiveRecord::Migration[5.2] SQL # this is not ideal we should be using SQL here but this will work around bad schema - ActiveRecord::Base.clear_cache! + ActiveRecord::Base.connection.query_cache.clear + Post.reset_column_information Post.where(topic_id: calendar_topic_ids).each { |post| CalendarEvent.update(post) } - ActiveRecord::Base.clear_cache! execute "DELETE FROM post_custom_fields WHERE name = 'calendar-details' OR name = 'calendar-holidays'" rescue => e