Is it a good idea to put db/schema.rb to .gitignore list ??

Viewed 16713

so what I'm suggesting in my job, is to put db/schema.rb into .gitignore file, so we don't have (time to time) merging problems.

There are some concerns that if something terrible happen (meteor fall from the sky right on the DB server and simultaneously all the db/migrete files are corrupt) we could loose the schema, and we will have to use rake db:purge (to reuse the schema.rb). I agree that this is possible and it's a good argument, but it shouldn't be problem because db/schema.rb is generated each time we do rake db:migrate. So even if we won't push schema.rb on server, we are pushing migrations add running db:migrate each time we are deploying with DB changes and with that db:migrate rails will automatically generate schema.rb on server side, and that schema.rb sits on the server unchanged until we do another db:migrate .

so whats your opinion, should we or should we not put the db/schema.rb into git ignore ?

thank you

3 Answers
Related