Sha256: f365960cbd998d985ddbfd4ff3333d5c2e07dd5e7061458c53f27bf1c0dc329f

Contents?: true

Size: 431 Bytes

Versions: 10

Compression:

Stored size: 431 Bytes

Contents

class AddAdvancedToTemplateInput < ActiveRecord::Migration
  def up
    add_column :template_inputs, :advanced, :boolean, :default => false, :null => false
    template = JobTemplate.find_by_name('Package Action - SSH Default')
    TemplateInput.where(:name => ['pre_script', 'post_script'], :template_id => template.try(:id)).update_all(:advanced => true)
  end

  def down
    remove_column :template_inputs, :advanced
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.0 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.2.2 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.2.1 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.2.0 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.1.1 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.1.0 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-1.0.0 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-0.3.2 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-0.3.1 db/migrate/20160127134031_add_advanced_to_template_input.rb
foreman_remote_execution-0.3.0 db/migrate/20160127134031_add_advanced_to_template_input.rb