Commit a0e65049 authored by Patrick Derichs's avatar Patrick Derichs

Ignore obsolete columns for resource_milestone_events

parent 08eec0c1
# frozen_string_literal: true # frozen_string_literal: true
class ResourceMilestoneEvent < ResourceEvent class ResourceMilestoneEvent < ResourceEvent
include IgnorableColumns
belongs_to :issue belongs_to :issue
belongs_to :merge_request belongs_to :merge_request
belongs_to :milestone belongs_to :milestone
...@@ -18,6 +20,8 @@ class ResourceMilestoneEvent < ResourceEvent ...@@ -18,6 +20,8 @@ class ResourceMilestoneEvent < ResourceEvent
# state is used for issue and merge request states. # state is used for issue and merge request states.
enum state: Issue.available_states.merge(MergeRequest.available_states) enum state: Issue.available_states.merge(MergeRequest.available_states)
ignore_columns %i[reference reference_html cached_markdown_version], remove_with: '13.1', remove_after: '2020-06-22'
def self.issuable_attrs def self.issuable_attrs
%i(issue merge_request).freeze %i(issue merge_request).freeze
end end
......
...@@ -74,7 +74,7 @@ module Issuable ...@@ -74,7 +74,7 @@ module Issuable
if matching_destination_milestone.present? if matching_destination_milestone.present?
event.attributes event.attributes
.except('id', 'reference', 'reference_html') .except('id')
.merge(entity_key => new_entity.id, .merge(entity_key => new_entity.id,
'milestone_id' => matching_destination_milestone.id, 'milestone_id' => matching_destination_milestone.id,
'action' => ResourceMilestoneEvent.actions[event.action], 'action' => ResourceMilestoneEvent.actions[event.action],
......
...@@ -112,9 +112,6 @@ describe Issuable::Clone::AttributesRewriter do ...@@ -112,9 +112,6 @@ describe Issuable::Clone::AttributesRewriter do
expect(event.milestone_id).to eq(expected_attrs[:milestone].id) expect(event.milestone_id).to eq(expected_attrs[:milestone].id)
expect(event.action).to eq(expected_attrs[:action]) expect(event.action).to eq(expected_attrs[:action])
expect(event.state).to eq(expected_attrs[:state]) expect(event.state).to eq(expected_attrs[:state])
expect(event.reference).to be_nil
expect(event.reference_html).to be_nil
end end
end end
end end
......
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