diff options
author | Maneschi Romain <rmaneschi@gmail.com> | 2019-07-03 16:09:51 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-07-03 16:09:51 +0000 |
commit | def94f5043abe57f453094fa570407e5b806c48a (patch) | |
tree | a96016ceab428c70f55da9fd173b224259388ed0 /db | |
parent | 6359a1fabdca65af1c1a514fda44a32bbfe5c4ec (diff) | |
download | gitlab-ce-def94f5043abe57f453094fa570407e5b806c48a.tar.gz |
Add Grafana to Admin > Monitoring menu when enabled
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190617123615_add_grafana_to_settings.rb | 18 | ||||
-rw-r--r-- | db/migrate/20190624123615_add_grafana_url_to_settings.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 38 insertions, 0 deletions
diff --git a/db/migrate/20190617123615_add_grafana_to_settings.rb b/db/migrate/20190617123615_add_grafana_to_settings.rb new file mode 100644 index 00000000000..f9c6f4d883e --- /dev/null +++ b/db/migrate/20190617123615_add_grafana_to_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddGrafanaToSettings < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + DOWNTIME = false + + def up + add_column_with_default(:application_settings, :grafana_enabled, :boolean, + default: false, allow_null: false) + end + + def down + remove_column(:application_settings, :grafana_enabled) + end +end diff --git a/db/migrate/20190624123615_add_grafana_url_to_settings.rb b/db/migrate/20190624123615_add_grafana_url_to_settings.rb new file mode 100644 index 00000000000..61efe64a7a1 --- /dev/null +++ b/db/migrate/20190624123615_add_grafana_url_to_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddGrafanaUrlToSettings < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + DOWNTIME = false + + def up + add_column_with_default(:application_settings, :grafana_url, :string, + default: '/-/grafana', allow_null: false) + end + + def down + remove_column(:application_settings, :grafana_url) + end +end diff --git a/db/schema.rb b/db/schema.rb index 32a25f643ce..4bcc8b5f1d7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -193,6 +193,7 @@ ActiveRecord::Schema.define(version: 20190628185004) do t.string "required_instance_ci_template" t.boolean "dns_rebinding_protection_enabled", default: true, null: false t.boolean "default_project_deletion_protection", default: false, null: false + t.boolean "grafana_enabled", default: false, null: false t.boolean "lock_memberships_to_ldap", default: false, null: false t.text "help_text" t.boolean "elasticsearch_indexing", default: false, null: false @@ -226,6 +227,7 @@ ActiveRecord::Schema.define(version: 20190628185004) do t.boolean "elasticsearch_limit_indexing", default: false, null: false t.string "geo_node_allowed_ips", default: "0.0.0.0/0, ::/0" t.boolean "time_tracking_limit_to_hours", default: false, null: false + t.string "grafana_url", default: "/-/grafana", null: false t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id", using: :btree t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id", using: :btree t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id", using: :btree |