2018-03-30 20:32:21 -04:00
|
|
|
## These tasks are destructive and are for clearing out all the
|
|
|
|
# content and users from your site, but keeping your site settings,
|
2018-04-26 12:46:32 -04:00
|
|
|
# theme, and category structure.
|
2018-03-30 20:32:21 -04:00
|
|
|
desc "Remove all topics in a category"
|
2018-09-10 07:52:14 -04:00
|
|
|
task "destroy:topics", [:category, :parent_category] => :environment do |t, args|
|
2018-03-30 20:32:21 -04:00
|
|
|
category = args[:category]
|
2018-09-10 07:52:14 -04:00
|
|
|
parent_category = args[:parent_category]
|
|
|
|
descriptive_slug = parent_category ? "#{parent_category}/#{category}" : category
|
|
|
|
puts "Going to delete all topics in the #{descriptive_slug} category"
|
|
|
|
puts log = DestroyTask.destroy_topics(category, parent_category)
|
2018-03-30 20:32:21 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Remove all topics in all categories"
|
|
|
|
task "destroy:topics_all_categories" => :environment do
|
|
|
|
puts "Going to delete all topics in all categories..."
|
|
|
|
puts log = DestroyTask.destroy_topics_all_categories
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Remove all private messages"
|
|
|
|
task "destroy:private_messages" => :environment do
|
|
|
|
puts "Going to delete all private messages..."
|
|
|
|
puts log = DestroyTask.destroy_private_messages
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Destroy all groups"
|
|
|
|
task "destroy:groups" => :environment do
|
|
|
|
puts "Going to delete all non-default groups..."
|
|
|
|
puts log = DestroyTask.destroy_groups
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Destroy all non-admin users"
|
|
|
|
task "destroy:users" => :environment do
|
|
|
|
puts "Going to delete all non-admin users..."
|
|
|
|
puts log = DestroyTask.destroy_users
|
|
|
|
end
|
|
|
|
|
2018-04-26 12:46:32 -04:00
|
|
|
desc "Destroy site stats"
|
2018-03-30 20:32:21 -04:00
|
|
|
task "destroy:stats" => :environment do
|
|
|
|
puts "Going to delete all site stats..."
|
|
|
|
DestroyTask.destroy_stats
|
|
|
|
end
|