discourse/db/migrate/20190705173948_renumber_group_visibility_levels.rb
Penar Musaraj b690fc3d98
FEATURE: Add new group visibility option for "logged on users" (#7814)
Groups can now be marked as visible to "logged on users". All automatic groups (except `everyone`) are now visible to "logged on users", previously they were marked as public but suppressed in the group page for non-staff.
2019-07-08 15:09:50 -04:00

17 lines
695 B
Ruby

# frozen_string_literal: true
class RenumberGroupVisibilityLevels < ActiveRecord::Migration[5.2]
def up
execute "UPDATE groups SET visibility_level = 4 WHERE visibility_level = 3"
execute "UPDATE groups SET visibility_level = 3 WHERE visibility_level = 2"
execute "UPDATE groups SET visibility_level = 2 WHERE visibility_level = 1"
end
def down
execute "UPDATE groups SET visibility_level = 0 WHERE visibility_level = 1"
execute "UPDATE groups SET visibility_level = 1 WHERE visibility_level = 2"
execute "UPDATE groups SET visibility_level = 2 WHERE visibility_level = 3"
execute "UPDATE groups SET visibility_level = 3 WHERE visibility_level = 4"
end
end