Project

General

Profile

Download (381 Bytes) Statistics
| Branch: | Tag: | Revision:
class AddManagedToHosts < ActiveRecord::Migration
def self.up
add_column :hosts, :managed, :boolean

Host.reset_column_information

for host in Host.all
host.update_attribute :managed, !!host.operatingsystem_id and !!host.architecture_id and (!!host.ptable_id or not host.disk.empty?)
end
end

def self.down
remove_column :hosts, :managed
end
end
(70-70/83)