mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-20 16:30:26 +00:00

Previously, the last push widget would only show when the branch never had a merge request associated with it - even merged or closed ones. Now the widget will disregard merge requests that are merged or closed.
19 lines
571 B
Ruby
19 lines
571 B
Ruby
class AddMergeRequestStateIndex < ActiveRecord::Migration
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
DOWNTIME = false
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
add_concurrent_index :merge_requests, [:source_project_id, :source_branch],
|
|
where: "state = 'opened'",
|
|
name: 'index_merge_requests_on_source_project_and_branch_state_opened'
|
|
end
|
|
|
|
def down
|
|
remove_concurrent_index_by_name :merge_requests,
|
|
'index_merge_requests_on_source_project_and_branch_state_opened'
|
|
end
|
|
end
|