Class: AddPartsFieldsToProducts
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- AddPartsFieldsToProducts
- Defined in:
- lib/generators/templates/db/migrate/20091029165620_add_parts_fields_to_products.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
9 10 11 12 13 14 |
# File 'lib/generators/templates/db/migrate/20091029165620_add_parts_fields_to_products.rb', line 9 def self.down change_table(:products) do |t| t.remove :can_be_part t.remove :individual_sale end end |
.up ⇒ Object
2 3 4 5 6 7 |
# File 'lib/generators/templates/db/migrate/20091029165620_add_parts_fields_to_products.rb', line 2 def self.up change_table(:products) do |t| t.column :can_be_part, :boolean, :default => false, :null => false t.column :individual_sale, :boolean, :default => true, :null => false end end |