DEV: Properly reset column information before seeding.
This commit is contained in:
parent
52580605d8
commit
3e888cbb5d
|
@ -1,5 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# fix any bust caches post initial migration
|
||||
ActiveRecord::Base.public_send(:subclasses).each { |m| m.reset_column_information }
|
||||
ActiveRecord::Base.connection.tables.each do |table|
|
||||
table.classify.constantize.reset_column_information rescue nil
|
||||
end
|
||||
|
||||
SiteSetting.refresh!
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'seed_data/topics'
|
||||
|
||||
User.reset_column_information
|
||||
Topic.reset_column_information
|
||||
Post.reset_column_information
|
||||
|
||||
if !Rails.env.test?
|
||||
require 'seed_data/topics'
|
||||
|
||||
topics_exist = Topic.where(<<~SQL).exists?
|
||||
id NOT IN (
|
||||
SELECT topic_id
|
||||
|
|
Loading…
Reference in New Issue