Backport `rake db:structure:dump`

Same as in https://github.com/square/rails/pull/1. We will need to do the same for `3-1` as it wasn't restored until `3-2` :(

/cc @tamird