Module: Switchman::ActiveRecord::Migrator

Defined in:
lib/switchman/active_record/migration.rb

Instance Method Summary collapse

Instance Method Details

#generate_migrator_advisory_lock_idObject



23
24
25
26
# File 'lib/switchman/active_record/migration.rb', line 23

def generate_migrator_advisory_lock_id
  shard_name_hash = Zlib.crc32("#{Shard.current.id}:#{Shard.current.name}")
  ::ActiveRecord::Migrator::MIGRATOR_SALT * shard_name_hash
end