Class: RaceGuard::IndexIntegrity::MissingIndexViolation

Inherits:
Struct
  • Object
show all
Defined in:
lib/race_guard/index_integrity/comparison_engine.rb

Overview

Match UniquenessValidation rows to unique indexes (Epic 5.3).

require "race_guard/index_integrity/comparison_engine"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#required_columnsObject

Returns the value of attribute required_columns

Returns:

  • (Object)

    the current value of required_columns



12
13
14
# File 'lib/race_guard/index_integrity/comparison_engine.rb', line 12

def required_columns
  @required_columns
end

#suggested_migrationObject

Returns the value of attribute suggested_migration

Returns:

  • (Object)

    the current value of suggested_migration



12
13
14
# File 'lib/race_guard/index_integrity/comparison_engine.rb', line 12

def suggested_migration
  @suggested_migration
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



12
13
14
# File 'lib/race_guard/index_integrity/comparison_engine.rb', line 12

def table
  @table
end

#validationObject

Returns the value of attribute validation

Returns:

  • (Object)

    the current value of validation



12
13
14
# File 'lib/race_guard/index_integrity/comparison_engine.rb', line 12

def validation
  @validation
end

Instance Method Details

#messageObject



14
15
16
17
18
19
20
# File 'lib/race_guard/index_integrity/comparison_engine.rb', line 14

def message
  cols = required_columns.sort.map(&:inspect).join(', ')
  <<~MSG.strip
    Missing unique index for #{validation.filename} (table :#{table}) columns [#{cols}]
      Suggested: #{suggested_migration}
  MSG
end