Module: Code0::ZeroTrack::Database::MigrationHelpers::IndexHelpers

Included in:
Code0::ZeroTrack::Database::Migration::V1_0
Defined in:
lib/code0/zero_track/database/migration_helpers/index_helpers.rb

Instance Method Summary collapse

Instance Method Details

#index_name(table, column, type) ⇒ Object



8
9
10
11
12
13
# File 'lib/code0/zero_track/database/migration_helpers/index_helpers.rb', line 8

def index_name(table, column, type)
  identifier = "#{table}_#{column}_index_#{type}"
  hashed_identifier = Digest::SHA256.hexdigest(identifier).first(10)

  "index_#{hashed_identifier}"
end