Class: Gitlab::BackgroundMigration::BackfillDraftStatusOnMergeRequestsWithCorrectedRegex::MergeRequest

Inherits:
ApplicationRecord
  • Object
show all
Includes:
EachBatch
Defined in:
lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex.rb

Overview

Migration only version of MergeRequest table

Constant Summary collapse

CORRECTED_REGEXP_STR =
"^(\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP)"

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Class Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Class Method Details

.eligibleObject



18
19
20
21
22
# File 'lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex.rb', line 18

def self.eligible
  where(state_id: 1)
    .where(draft: false)
    .where("title ~* ?", CORRECTED_REGEXP_STR)
end