Sha256: 7406e8b35c2762474f8a7dc4ff762a6de44889b4f156d471d9d036e249b59d47

Contents?: true

Size: 438 Bytes

Versions: 8

Compression:

Stored size: 438 Bytes

Contents

class AddExecutionToInterface < ActiveRecord::Migration
  class FakeNic < ActiveRecord::Base
    self.table_name = 'nics'

    def type
      Nic::Managed
    end
  end

  def up
    add_column :nics, :execution, :boolean, :default => false

    FakeNic.reset_column_information
    FakeNic.all.each do |nic|
      nic.update_column(:execution, true) if nic.primary
    end
  end

  def down
    remove_column :nics, :execution
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.6 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.4.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.5 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.4 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.3 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.2 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.3.1 db/migrate/20150903192731_add_execution_to_interface.rb