diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-18 08:26:43 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-18 08:26:43 +0000 |
commit | f1083ba1f6e4ff0c01d5e08b2a6c0b1f9b5a9b9a (patch) | |
tree | 1fff55ef67c0dadb5f77cf138d2c0cfd291b2b21 /db | |
parent | 7af92af5fe2a7c5c4be91d0d6daea61fc032d6f4 (diff) | |
parent | 9d72d902cf21c786b871eced12609a793596cf29 (diff) | |
download | gitlab-ce-f1083ba1f6e4ff0c01d5e08b2a6c0b1f9b5a9b9a.tar.gz |
Merge branch 'track-pipeline-user' into 'master'
Track a user who creates a Pipeline
## What does this MR do?
This adds additional column to pipelines to track user who is creating pipelines.
## Why was this MR needed?
This is to make it possible to show all pipelines created by specific user and to later solve: https://gitlab.com/gitlab-org/gitlab-ce/issues/18054
## What are the relevant issue numbers?
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18992
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5272
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160715132507_add_user_id_to_pipeline.rb | 7 | ||||
-rw-r--r-- | db/migrate/20160715134306_add_index_for_pipeline_user_id.rb | 7 | ||||
-rw-r--r-- | db/schema.rb | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/db/migrate/20160715132507_add_user_id_to_pipeline.rb b/db/migrate/20160715132507_add_user_id_to_pipeline.rb new file mode 100644 index 00000000000..af0461c4daf --- /dev/null +++ b/db/migrate/20160715132507_add_user_id_to_pipeline.rb @@ -0,0 +1,7 @@ +class AddUserIdToPipeline < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + def change + add_column :ci_commits, :user_id, :integer + end +end diff --git a/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb b/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb new file mode 100644 index 00000000000..e09caa0e6d7 --- /dev/null +++ b/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb @@ -0,0 +1,7 @@ +class AddIndexForPipelineUserId < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + def change + add_concurrent_index :ci_commits, :user_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 8c12898eec9..48ecdc6ba1b 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: 20160712171823) do +ActiveRecord::Schema.define(version: 20160715134306) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -199,6 +199,7 @@ ActiveRecord::Schema.define(version: 20160712171823) do t.datetime "started_at" t.datetime "finished_at" t.integer "duration" + t.integer "user_id" end add_index "ci_commits", ["gl_project_id", "sha"], name: "index_ci_commits_on_gl_project_id_and_sha", using: :btree @@ -210,6 +211,7 @@ ActiveRecord::Schema.define(version: 20160712171823) do add_index "ci_commits", ["project_id"], name: "index_ci_commits_on_project_id", using: :btree add_index "ci_commits", ["sha"], name: "index_ci_commits_on_sha", using: :btree add_index "ci_commits", ["status"], name: "index_ci_commits_on_status", using: :btree + add_index "ci_commits", ["user_id"], name: "index_ci_commits_on_user_id", using: :btree create_table "ci_events", force: :cascade do |t| t.integer "project_id" |