Multiple `master` branches showing up in protected branches list
ZD: https://gitlab.zendesk.com/agent/tickets/38238
Somehow the database got populated with multiple master
branches. Running the rails console confirms this:
irb(main):001:0> ProtectedBranch.where(project: Project.find_with_namespace('group/space'))
=> #<ActiveRecord::Relation [#<ProtectedBranch id: 33, project_id: 31, name: "master", created_at: "2016-08-28 22:49:57", updated_at: "2016-08-28 22:49:57", developers_can_push: false>, #<ProtectedBranch id: 42, project_id: 31, name: "master", created_at: "2016-08-28 22:59:31", updated_at: "2016-08-28 22:59:31", developers_can_push: false>, #<ProtectedBranch id: 44, project_id: 31, name: "master", created_at: "2016-08-28 23:13:56", updated_at: "2016-08-28 23:13:56", developers_can_push: false>, #<ProtectedBranch id: 45, project_id: 31, name: "master", created_at: "2016-08-28 23:27:16", updated_at: "2016-08-28 23:27:16", developers_can_push: false>, #<ProtectedBranch id: 47, project_id: 31, name: "master", created_at: "2016-08-28 23:42:54", updated_at: "2016-08-28 23:42:54", developers_can_push: false>, #<ProtectedBranch id: 48, project_id: 31, name: "master", created_at: "2016-08-28 23:59:20", updated_at: "2016-08-28 23:59:20", developers_can_push: false>, #<ProtectedBranch id: 49, project_id: 31, name: "master", created_at: "2016-08-29 00:15:21", updated_at: "2016-08-29 00:15:21", developers_can_push: false>, #<ProtectedBranch id: 50, project_id: 31, name: "master", created_at: "2016-08-29 00:31:26", updated_at: "2016-08-29 00:31:26", developers_can_push: false>, #<ProtectedBranch id: 51, project_id: 31, name: "master", created_at: "2016-08-29 00:47:27", updated_at: "2016-08-29 00:47:27", developers_can_push: false>, #<ProtectedBranch id: 52, project_id: 31, name: "master", created_at: "2016-08-29 01:03:18", updated_at: "2016-08-29 01:03:18", developers_can_push: false>, ...]>
@timothyandrew, did this somehow get caused by a migration?