fixed bugs in ActiveRecord migrations