Upgrade migrations to work with Rails 4.

I ran `rake db:create db:migrate` when trying to get unit tests working, and I ran into a few errors.

Here are the fixes.