Sha256: 9b457b1dfd31a1b2f9ed777fa6595036e56d0cbe3e85359f80fd5d1b227a6931

Contents?: true

Size: 535 Bytes

Versions: 19

Compression:

Stored size: 535 Bytes

Contents

# -*- encoding : utf-8 -*-
class Add<%= @field.singular_name.foreign_key.camelize %>To<%= @table.plural_name.camelize %> < ActiveRecord::Migration

	def self.up
		add_column :<%= @table.plural_name %>, :<%= @field.singular_name.foreign_key %>, :integer
		add_index :<%= @table.plural_name %>, :<%= @field.singular_name.foreign_key %>
	end

	def self.down 
		remove_column :<%= @table.plural_name %>, :<%= @field.singular_name.foreign_key %>
		remove_index :<%= @table.plural_name %>, :<%= @field.singular_name.foreign_key %>
	end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mdd-3.1.4 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.1.2 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.1.1 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.1.0 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.20 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.19 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.18 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.17 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.16 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.15 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.14 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.13 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.10 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.9 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.8 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.7 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.6 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.4 lib/generators/mdwa/association/templates/migrate/one_field.rb
mdd-3.0.3 lib/generators/mdwa/association/templates/migrate/one_field.rb