fix-db-schema-conflicts
It prevents db/schema.rb conflicts in your Rails projects when working with multiple team members.
Installation
Add this line to your application's Gemfile in your development group:
gem 'fix-db-schema-conflicts'
And then execute:
$ bundle
Usage
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.
How it works
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.
Contributing
- 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