diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb b/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb new file mode 100644 index 0000000..2f88ad4 --- /dev/null +++ b/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb @@ -0,0 +1,17 @@ +class AddAmountOfDisplayedPhoneNumbersToSwitchboard < ActiveRecord::Migration + def up + add_column :switchboards, :amount_of_displayed_phone_numbers, :integer + + # Set a default for existing entries of + # 1 for amount_of_displayed_phone_numbers + # + Switchboard.all.each do |switchboard| + switchboard.amount_of_displayed_phone_numbers = 1 + switchboard.save + end + end + + def down + remove_column :switchboards, :amount_of_displayed_phone_numbers, :integer + end +end |