Open-Source-Access-Control-.../db/migrate/20121014120609_move_card_data_to_cards.rb
2014-02-09 00:56:48 -07:00

12 lines
296 B
Ruby
Executable File

class MoveCardDataToCards < ActiveRecord::Migration
def up
User.all.each do |u|
u.cards.create(:id => u.card_id, :name => u.name, :card_number => u.card_number, :card_permissions => u.card_permissions)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end