class SetNetworkIdInApProfile < ActiveRecord::Migration[6.0]
  def self.up
   RouterInventory.includes(:location_network).all.each do |ri|
    $redis.hset "AP:#{ri.mac_id}", "ln_id", ri.location_network.try(:id)
   end
  end

  def self.down
   RouterInventory.includes(:location_network).all.each do |ri|
    $redis.hset "AP:#{ri.mac_id}", "ln_id", '' 
   end
  end
end
