class AddTenantDefaultGroup < ActiveRecord::Migration
  def change
    add_column :tenants, :default_miq_group_id, :bigint
  end
end

class AddTenantDefaultGroup < ActiveRecord::Migration
  class Tenant < ActiveRecord::Base; end

  def change
    add_column :tenants, :default_miq_group_id, :bigint
    Tenant.reset_column_information
  end
end

Reset the column cache after adding default_miq_group_id to tenants
Reset the column cache after adding default_miq_group_id to tenants

Before this change, rails was not aware of the column if it was
added in the same process that it was queried in.

Specifically, the column cache is not reset after the `add_column` call;
so for 20151021174140_assign_tenant_default_group.rb to work properly
we need to reset the info manually via `Tenant.reset_column_information`.

For example, the column would be added, but when we tried to set the
value in 20151021174140_assign_tenant_default_group.rb we would
silently fail or get a backtrace with:

`99000000000001 is out of range for ActiveModel::Type::Integer with limit 4`

After this change, the column value is set correctly.

https://bugzilla.redhat.com/show_bug.cgi?id=1344112
