mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:53:41 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
20 lines
411 B
Ruby
20 lines
411 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'seed_data/topics'
|
|
|
|
User.reset_column_information
|
|
Topic.reset_column_information
|
|
Post.reset_column_information
|
|
|
|
if !Rails.env.test?
|
|
topics_exist = Topic.where(<<~SQL).exists?
|
|
id NOT IN (
|
|
SELECT topic_id
|
|
FROM categories
|
|
WHERE topic_id IS NOT NULL
|
|
)
|
|
SQL
|
|
|
|
SeedData::Topics.with_default_locale.create(include_welcome_topics: !topics_exist)
|
|
end
|