mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 23:05:30 +08:00
DEV: Properly reset column information before seeding.
This commit is contained in:
parent
52580605d8
commit
3e888cbb5d
@ -1,5 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# fix any bust caches post initial migration
|
# 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!
|
SiteSetting.refresh!
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'seed_data/topics'
|
|
||||||
|
|
||||||
User.reset_column_information
|
|
||||||
Topic.reset_column_information
|
|
||||||
Post.reset_column_information
|
|
||||||
|
|
||||||
if !Rails.env.test?
|
if !Rails.env.test?
|
||||||
|
require 'seed_data/topics'
|
||||||
|
|
||||||
topics_exist = Topic.where(<<~SQL).exists?
|
topics_exist = Topic.where(<<~SQL).exists?
|
||||||
id NOT IN (
|
id NOT IN (
|
||||||
SELECT topic_id
|
SELECT topic_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user