It prevents db/schema.rb conflicts in your Rails projects when working with multiple team members.
Add this line to your application's Gemfile in your development group:
gem 'fix-db-schema-conflicts'
And then execute:
$ bundle
You don't have to do anything different. It should just work. Simply run rake db:migrate
or rake db:schema:dump
as you would before and fix-db-schema-conflicts
will do the rest.
This gem sorts the table, index, and foreign key names before outputting them to the schema.rb file. Additionally it runs Rubocop with the auto-correct flag to ensure a consistent output format. Then it runs sed
to cleanup additional horizontal whitespace inserted by Rails.
- Fork it ( https://github.com/[my-github-username]/fix-db-schema-conflicts/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request