diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-06 12:50:26 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-06 12:50:26 +0300 |
commit | 0f871450cd3e77b0a94769a12d2d100a6d093e2c (patch) | |
tree | e55931cd35ab702e8a1da26e6044d2e1fdc90281 /db/migrate | |
parent | 313b79d87bd65864307e6864080e12bdbab7c4ab (diff) |
Hide for instance statistics by default
Changing the default in a new migration and updating the existing
values to change the defaults for instances already exposing the statistics.
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20180806094307_change_instance_stats_visibility_default.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20180806094307_change_instance_stats_visibility_default.rb b/db/migrate/20180806094307_change_instance_stats_visibility_default.rb new file mode 100644 index 00000000000..4c27cfb8cab --- /dev/null +++ b/db/migrate/20180806094307_change_instance_stats_visibility_default.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class ChangeInstanceStatsVisibilityDefault < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + change_column_default :application_settings, + :instance_statistics_visibility_private, + true + ApplicationSetting.update_all(instance_statistics_visibility_private: true) + end + + def down + change_column_default :application_settings, + :instance_statistics_visibility_private, + false + end +end |