Commit 603412af authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'ce-9688-mr-merge-order' into 'master'

CE backport of merge request blocks - backend MVC

See merge request gitlab-org/gitlab-ce!27323
parents 3f6f40b3 df778038
# frozen_string_literal: true
class AddMergeRequestBlocks < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :merge_request_blocks, id: :bigserial do |t|
t.references :blocking_merge_request,
index: false, null: false,
foreign_key: { to_table: :merge_requests, on_delete: :cascade }
t.references :blocked_merge_request,
index: true, null: false,
foreign_key: { to_table: :merge_requests, on_delete: :cascade }
t.index [:blocking_merge_request_id, :blocked_merge_request_id],
unique: true,
name: 'index_mr_blocks_on_blocking_and_blocked_mr_ids'
t.timestamps_with_timezone
end
end
end
...@@ -1227,6 +1227,15 @@ ActiveRecord::Schema.define(version: 20190506135400) do ...@@ -1227,6 +1227,15 @@ ActiveRecord::Schema.define(version: 20190506135400) do
t.index ["user_id"], name: "index_merge_request_assignees_on_user_id", using: :btree t.index ["user_id"], name: "index_merge_request_assignees_on_user_id", using: :btree
end end
create_table "merge_request_blocks", force: :cascade do |t|
t.integer "blocking_merge_request_id", null: false
t.integer "blocked_merge_request_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.index ["blocked_merge_request_id"], name: "index_merge_request_blocks_on_blocked_merge_request_id", using: :btree
t.index ["blocking_merge_request_id", "blocked_merge_request_id"], name: "index_mr_blocks_on_blocking_and_blocked_mr_ids", unique: true, using: :btree
end
create_table "merge_request_diff_commits", id: false, force: :cascade do |t| create_table "merge_request_diff_commits", id: false, force: :cascade do |t|
t.datetime_with_timezone "authored_date" t.datetime_with_timezone "authored_date"
t.datetime_with_timezone "committed_date" t.datetime_with_timezone "committed_date"
...@@ -2514,6 +2523,8 @@ ActiveRecord::Schema.define(version: 20190506135400) do ...@@ -2514,6 +2523,8 @@ ActiveRecord::Schema.define(version: 20190506135400) do
add_foreign_key "members", "users", name: "fk_2e88fb7ce9", on_delete: :cascade add_foreign_key "members", "users", name: "fk_2e88fb7ce9", on_delete: :cascade
add_foreign_key "merge_request_assignees", "merge_requests", on_delete: :cascade add_foreign_key "merge_request_assignees", "merge_requests", on_delete: :cascade
add_foreign_key "merge_request_assignees", "users", on_delete: :cascade add_foreign_key "merge_request_assignees", "users", on_delete: :cascade
add_foreign_key "merge_request_blocks", "merge_requests", column: "blocked_merge_request_id", on_delete: :cascade
add_foreign_key "merge_request_blocks", "merge_requests", column: "blocking_merge_request_id", on_delete: :cascade
add_foreign_key "merge_request_diff_commits", "merge_request_diffs", on_delete: :cascade add_foreign_key "merge_request_diff_commits", "merge_request_diffs", on_delete: :cascade
add_foreign_key "merge_request_diff_files", "merge_request_diffs", on_delete: :cascade add_foreign_key "merge_request_diff_files", "merge_request_diffs", on_delete: :cascade
add_foreign_key "merge_request_diffs", "merge_requests", name: "fk_8483f3258f", on_delete: :cascade add_foreign_key "merge_request_diffs", "merge_requests", name: "fk_8483f3258f", on_delete: :cascade
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment