diff --git a/db/migrate/20200912130614_fix_reference_for_all_resources.decidim.rb b/db/migrate/20200912130614_fix_reference_for_all_resources.decidim.rb index 1bb08f7fd..ad0dd8505 100644 --- a/db/migrate/20200912130614_fix_reference_for_all_resources.decidim.rb +++ b/db/migrate/20200912130614_fix_reference_for_all_resources.decidim.rb @@ -6,6 +6,8 @@ def up models = ActiveRecord::Base.descendants.select { |c| c.included_modules.include?(Decidim::HasReference) } models.each do |model| + next unless model.table_exists? + model.find_each(&:touch) end end