discourse/db/fixtures/990_topics.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
411 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'seed_data/topics'
2013-12-15 20:46:46 -05:00
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