Why does schema.rb change (in the eyes of Git) when just running rake db:migrate?!
Posted
by erskingardner
on Stack Overflow
See other posts from Stack Overflow
or by erskingardner
Published on 2010-06-05T07:12:40Z
Indexed on
2010/06/05
7:22 UTC
Read the original article
Hit count: 192
This is a little general I know, but it's been bugging the hell out of me. I've been working on lots of rails projects remotely with Git and every time I do a git pull
and see that there is some sort of data change (migration, or schema.rb change) I do a rake db:migrate
.
These generally run fine and I can continue working. But if you do a git pull
and then git status
, your working directory is clean (obviously) then do a rake db:migrate
(obviously when there are changes) and another git status
and all the sudden your db/schema.rb has changed. I have been just doing a git checkout
immediately to reset back to the latest committed version of the schema.rb file, but why should this be necessary?! What is rails doing? Updating a timestamp? I can't seem to figure out what the diff is but maybe I'm just missing something?
© Stack Overflow or respective owner