1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/db/migrate/20170227104934_migrate_slots_reservations.rb

14 lines
348 B
Ruby
Raw Normal View History

class MigrateSlotsReservations < ActiveRecord::Migration
def up
Slot.all.each do |slot|
SlotsReservation.create!({slot_id: slot.id, reservation_id: slot.reservation_id})
end
end
def down
SlotsReservation.all.each do |sr|
Slot.find(sr.slot_id).update_attributes(:reservation_id => sr.reservation_id)
end
end
end