summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-08-06 11:50:26 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-08-06 11:50:26 +0200
commit0f871450cd3e77b0a94769a12d2d100a6d093e2c (patch)
treee55931cd35ab702e8a1da26e6044d2e1fdc90281 /db
parent313b79d87bd65864307e6864080e12bdbab7c4ab (diff)
downloadgitlab-ce-0f871450cd3e77b0a94769a12d2d100a6d093e2c.tar.gz
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')
-rw-r--r--db/migrate/20180806094307_change_instance_stats_visibility_default.rb23
-rw-r--r--db/schema.rb4
2 files changed, 25 insertions, 2 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
diff --git a/db/schema.rb b/db/schema.rb
index 2bef2971f29..924d2d81dcc 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20180726172057) do
+ActiveRecord::Schema.define(version: 20180806094307) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -168,7 +168,7 @@ ActiveRecord::Schema.define(version: 20180726172057) do
t.boolean "enforce_terms", default: false
t.boolean "mirror_available", default: true, null: false
t.boolean "hide_third_party_offers", default: false, null: false
- t.boolean "instance_statistics_visibility_private", default: false, null: false
+ t.boolean "instance_statistics_visibility_private", default: true, null: false
end
create_table "audit_events", force: :cascade do |t|