Commit fbf8dd3e authored by Andreas Brandl's avatar Andreas Brandl

Add more column ignores

parent 112343b7
...@@ -14,6 +14,7 @@ class Issue < ApplicationRecord ...@@ -14,6 +14,7 @@ class Issue < ApplicationRecord
include TimeTrackable include TimeTrackable
include ThrottledTouch include ThrottledTouch
include LabelEventable include LabelEventable
include IgnorableColumns
DueDateStruct = Struct.new(:title, :name).freeze DueDateStruct = Struct.new(:title, :name).freeze
NoDueDate = DueDateStruct.new('No Due Date', '0').freeze NoDueDate = DueDateStruct.new('No Due Date', '0').freeze
...@@ -68,8 +69,7 @@ class Issue < ApplicationRecord ...@@ -68,8 +69,7 @@ class Issue < ApplicationRecord
scope :counts_by_state, -> { reorder(nil).group(:state_id).count } scope :counts_by_state, -> { reorder(nil).group(:state_id).count }
# Only remove after 2019-12-22 and with %12.7 ignore_column :state, remove_with: '12.7', remove_after: '2019-12-22'
self.ignored_columns += %i[state]
after_commit :expire_etag_cache after_commit :expire_etag_cache
after_save :ensure_metrics, unless: :imported? after_save :ensure_metrics, unless: :imported?
......
...@@ -17,6 +17,7 @@ class MergeRequest < ApplicationRecord ...@@ -17,6 +17,7 @@ class MergeRequest < ApplicationRecord
include FromUnion include FromUnion
include DeprecatedAssignee include DeprecatedAssignee
include ShaAttribute include ShaAttribute
include IgnorableColumns
sha_attribute :squash_commit_sha sha_attribute :squash_commit_sha
...@@ -231,8 +232,7 @@ class MergeRequest < ApplicationRecord ...@@ -231,8 +232,7 @@ class MergeRequest < ApplicationRecord
with_state(:opened).where(auto_merge_enabled: true) with_state(:opened).where(auto_merge_enabled: true)
end end
# Only remove after 2019-12-22 and with %12.7 ignore_column :state, remove_with: '12.7', remove_after: '2019-12-22'
self.ignored_columns += %i[state]
after_save :keep_around_commit after_save :keep_around_commit
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectCiCdSetting < ApplicationRecord class ProjectCiCdSetting < ApplicationRecord
# TODO: remove once GitLab 12.7 is released include IgnorableColumns
# https://gitlab.com/gitlab-org/gitlab/issues/36651 # https://gitlab.com/gitlab-org/gitlab/issues/36651
self.ignored_columns += %i[merge_trains_enabled] ignore_column :merge_trains_enabled, remove_with: '12.7', remove_after: '2019-12-22'
belongs_to :project, inverse_of: :ci_cd_settings belongs_to :project, inverse_of: :ci_cd_settings
# The version of the schema that first introduced this model/table. # The version of the schema that first introduced this model/table.
......
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