summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-15 15:22:35 +0100
committerJames Lopez <james@jameslopez.es>2016-11-17 08:22:58 +0100
commitca6da6ea3034a58c0edbc62336d2d49ea6e11fc9 (patch)
tree91e9bb0520f6310b210e26b70d88fc779fdbe4c7 /db
parent73e9ec631995d5ed91a3eb5e8416c924e7d7c5ad (diff)
downloadgitlab-ce-ca6da6ea3034a58c0edbc62336d2d49ea6e11fc9.tar.gz
Renamed pipeline column and fixed permissions for builds in events controller
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb4
-rw-r--r--db/schema.rb6
2 files changed, 6 insertions, 4 deletions
diff --git a/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb b/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
index a47e1ae7f6a..507d576d0bc 100644
--- a/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
+++ b/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
@@ -24,6 +24,8 @@ class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration
# disable_ddl_transaction!
def change
- add_reference :merge_request_metrics, :ci_commit, index: true, foreign_key: { on_delete: :cascade }
+ add_column :merge_request_metrics, :pipeline_id, :integer
+ add_index :merge_request_metrics, :pipeline_id
+ add_foreign_key :merge_request_metrics, :ci_commits, column: :pipeline_id, on_delete: :cascade
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 5baa82e1058..983e1c90682 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -634,12 +634,12 @@ ActiveRecord::Schema.define(version: 20161109150329) do
t.datetime "merged_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.integer "ci_commit_id"
+ t.integer "pipeline_id"
end
- add_index "merge_request_metrics", ["ci_commit_id"], name: "index_merge_request_metrics_on_ci_commit_id", using: :btree
add_index "merge_request_metrics", ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at", using: :btree
add_index "merge_request_metrics", ["merge_request_id"], name: "index_merge_request_metrics", using: :btree
+ add_index "merge_request_metrics", ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id", using: :btree
create_table "merge_requests", force: :cascade do |t|
t.string "target_branch", null: false
@@ -1246,7 +1246,7 @@ ActiveRecord::Schema.define(version: 20161109150329) do
add_foreign_key "labels", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "lists", "boards"
add_foreign_key "lists", "labels"
- add_foreign_key "merge_request_metrics", "ci_commits", on_delete: :cascade
+ add_foreign_key "merge_request_metrics", "ci_commits", column: "pipeline_id", on_delete: :cascade
add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade
add_foreign_key "merge_requests_closing_issues", "issues", on_delete: :cascade
add_foreign_key "merge_requests_closing_issues", "merge_requests", on_delete: :cascade