Sha256: 92ac14e2bf9df3c30696f58c56a862d1acbed3d89dffcd2345ac41c9c04de896

Contents?: true

Size: 426 Bytes

Versions: 19

Compression:

Stored size: 426 Bytes

Contents

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

  def type
    Nic::Managed
  end
end

class AddExecutionToInterface < ActiveRecord::Migration
  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

19 entries across 19 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.2.2 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.2.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.2.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.1.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.1.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-1.0.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.3.2 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.3.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.3.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.2.3 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.2.2 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.2.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.1.2 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.1.1 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.1.0 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.0.10 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.0.8 db/migrate/20150903192731_add_execution_to_interface.rb
foreman_remote_execution-0.0.7 db/migrate/20150903192731_add_execution_to_interface.rb