Fix some deprecations and migrate schema.rb