Don't Just Ignore schema.rb!

Posted by Peter Wagenet Fri, 05 Dec 2008 18:21:00 GMT

It’s a long standing practice among many Rails developers to have their version control ignore schema.rb. However this practice is contrary to that recommended by the Rails source itself! As you can see from this commit, DHH himself highly encourages that you check in into version control. This alone should be good reason to pause and consider if we should keep ignoring schema.rb.

Now, I know that some developers prefer to use migrations as their main reference. Though migrations can be unstable, they argue that properly maintained migrations won’t have issues. And that’s fine. If you have a good reason to go against Rails conventions then I won’t stop you, every developer should know what works best for their own projects and development style. However, I’ve heard just as many developers argue that using schema.rb causes problems with their version control or breaks things in some other way. If this is the case then the answer is not to just ignore it. If schema.rb doesn’t work the way it should, then it’s a bug and should be reported as such! Ignoring it is just a stopgap measure at best and should not be considered a long term solution when things are actually broken.

Comments

Leave a comment

Comments