summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorPavel Shutsin <pshutsin@gitlab.com>2019-07-30 13:03:03 +0300
committerPavel Shutsin <pshutsin@gitlab.com>2019-08-06 11:38:50 +0300
commit1cc87f503c524357f4edcb0f7fda2160aa88c816 (patch)
tree992c330f1432ea43eb15c67bdb75f65ec053b06e /db
parent7583f5349ff5d919d6d22b36e59efef1d4a93fb3 (diff)
downloadgitlab-ce-1cc87f503c524357f4edcb0f7fda2160aa88c816.tar.gz
Add migrations for productivity analytics
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190627100221_add_mr_productivity_metrics.rb14
-rw-r--r--db/schema.rb6
2 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20190627100221_add_mr_productivity_metrics.rb b/db/migrate/20190627100221_add_mr_productivity_metrics.rb
new file mode 100644
index 00000000000..b6f1520cb2d
--- /dev/null
+++ b/db/migrate/20190627100221_add_mr_productivity_metrics.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddMrProductivityMetrics < ActiveRecord::Migration[5.1]
+ DOWNTIME = false
+
+ def change
+ add_column :merge_request_metrics, :first_comment_at, :datetime_with_timezone
+ add_column :merge_request_metrics, :first_commit_at, :datetime_with_timezone
+ add_column :merge_request_metrics, :last_commit_at, :datetime_with_timezone
+ add_column :merge_request_metrics, :diff_size, :integer
+ add_column :merge_request_metrics, :modified_paths_size, :integer
+ add_column :merge_request_metrics, :commits_count, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a9b7c1930e3..90d93ddc736 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1979,6 +1979,12 @@ ActiveRecord::Schema.define(version: 2019_08_02_012622) do
t.integer "merged_by_id"
t.integer "latest_closed_by_id"
t.datetime_with_timezone "latest_closed_at"
+ t.datetime_with_timezone "first_comment_at"
+ t.datetime_with_timezone "first_commit_at"
+ t.datetime_with_timezone "last_commit_at"
+ t.integer "diff_size"
+ t.integer "modified_paths_size"
+ t.integer "commits_count"
t.index ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at"
t.index ["latest_closed_at"], name: "index_merge_request_metrics_on_latest_closed_at", where: "(latest_closed_at IS NOT NULL)"
t.index ["latest_closed_by_id"], name: "index_merge_request_metrics_on_latest_closed_by_id"