summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Cobb <rcobb@gitlab.com>2019-06-13 15:06:48 -0600
committerRyan Cobb <rcobb@gitlab.com>2019-06-13 15:06:48 -0600
commit58c07133002ec190df4baee59440ba603646631f (patch)
tree0310440fb4aab8a84f1ff1b3efb8153461e1d690
parentb05de5a583e35931967dcc70d2f26f568c9cf0db (diff)
downloadgitlab-ce-63044-add-metric-type.tar.gz
Add metric_type to PrometheusMetric63044-add-metric-type
-rw-r--r--db/migrate/20190612195231_add_metric_type_to_prometheus_metrics.rb15
-rw-r--r--db/schema.rb3
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
3 files changed, 18 insertions, 1 deletions
diff --git a/db/migrate/20190612195231_add_metric_type_to_prometheus_metrics.rb b/db/migrate/20190612195231_add_metric_type_to_prometheus_metrics.rb
new file mode 100644
index 00000000000..c2e74a58331
--- /dev/null
+++ b/db/migrate/20190612195231_add_metric_type_to_prometheus_metrics.rb
@@ -0,0 +1,15 @@
+# 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 AddMetricTypeToPrometheusMetrics < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ add_column :prometheus_metrics, :metric_type, :integer, index: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 392edf89430..be54c6eef6e 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: 20190611161641) do
+ActiveRecord::Schema.define(version: 20190612195231) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1864,6 +1864,7 @@ ActiveRecord::Schema.define(version: 20190611161641) do
t.datetime_with_timezone "updated_at", null: false
t.boolean "common", default: false, null: false
t.string "identifier"
+ t.integer "metric_type"
t.index ["common"], name: "index_prometheus_metrics_on_common", using: :btree
t.index ["group"], name: "index_prometheus_metrics_on_group", using: :btree
t.index ["identifier"], name: "index_prometheus_metrics_on_identifier", unique: true, using: :btree
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 9093d21647a..29a3a20a66a 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -587,6 +587,7 @@ PrometheusMetric:
- group
- common
- identifier
+- metric_type
Badge:
- id
- link_url