diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-26 18:24:14 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-26 18:24:14 +0000 |
commit | 8c28c3e84eb3e330f10bf2c765668a23dfce5080 (patch) | |
tree | f48f0f99308bd9c6c81b7d318d79a72d1776f232 /db | |
parent | 2b00b61eba758baf9d4242ba9c71f2319f8ec428 (diff) | |
parent | cd8aaea36f3c2b69c7c48c00ed56de14267969dd (diff) | |
download | gitlab-ce-8c28c3e84eb3e330f10bf2c765668a23dfce5080.tar.gz |
Merge branch 'refactor/remove-sentry-from-app-settings' into 'master'
Remove Sentry settings from application settings
See merge request gitlab-org/gitlab-ce!28447
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb | 38 | ||||
-rw-r--r-- | db/schema.rb | 6 |
2 files changed, 39 insertions, 5 deletions
diff --git a/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb b/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb new file mode 100644 index 00000000000..427df343193 --- /dev/null +++ b/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb @@ -0,0 +1,38 @@ +# 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 RemoveSentryFromApplicationSettings < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + SENTRY_ENABLED_COLUMNS = [ + :sentry_enabled, + :clientside_sentry_enabled + ].freeze + + SENTRY_DSN_COLUMNS = [ + :sentry_dsn, + :clientside_sentry_dsn + ].freeze + + disable_ddl_transaction! + + def up + (SENTRY_ENABLED_COLUMNS + SENTRY_DSN_COLUMNS).each do |column| + remove_column(:application_settings, column) if column_exists?(:application_settings, column) + end + end + + def down + SENTRY_ENABLED_COLUMNS.each do |column| + add_column_with_default(:application_settings, column, :boolean, default: false, allow_null: false) unless column_exists?(:application_settings, column) + end + + SENTRY_DSN_COLUMNS.each do |column| + add_column(:application_settings, column, :string) unless column_exists?(:application_settings, column) + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 192ec8007d9..054dbc7201f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190620112608) do +ActiveRecord::Schema.define(version: 20190625184066) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -93,8 +93,6 @@ ActiveRecord::Schema.define(version: 20190620112608) do t.boolean "akismet_enabled", default: false t.string "akismet_api_key" t.integer "metrics_sample_interval", default: 15 - t.boolean "sentry_enabled", default: false - t.string "sentry_dsn" t.boolean "email_author_in_body", default: false t.integer "default_group_visibility" t.boolean "repository_checks_enabled", default: false @@ -135,8 +133,6 @@ ActiveRecord::Schema.define(version: 20190620112608) do t.string "uuid" t.decimal "polling_interval_multiplier", default: "1.0", null: false t.integer "cached_markdown_version" - t.boolean "clientside_sentry_enabled", default: false, null: false - t.string "clientside_sentry_dsn" t.boolean "prometheus_metrics_enabled", default: true, null: false t.boolean "help_page_hide_commercial_content", default: false t.string "help_page_support_url" |