Pito,

I'm going to leave the entire db version control question for someone
else, but to answer your question about the schema.rb, if you run a
migration, it will change the structure of the database, which is what
schema.rb keeps track of. Rails will rewrite that file every for every
migration ran to reflect the current structure of the db ( structure
as in tables, column names, indexes, etc... Not data the records
stored in the db ). This file should be checked into git, and like any
file that changes under version control, git will let you know about
the changes and track them.

As your app grows, your migration files will be more prone to hving
problems and shouldn't be used to create / setup the database. The
schema file is much better at recreating the db structure when
starting fresh ( like if you have to scale up your app and create a
new db on another server ). There are rake tasks for this, such as
rake db:reset ( caution, that one will wipe out all data in db), so
read up on them and they can save you many headaches as you have to
move your databases around.

-Matt

On Apr 20, 9:25 am, Pito Salas <[email protected]> wrote:
> This maybe too vague a question, but I wonder if there's some wisdom out
> there for me to tap...
>
> Sometimes when I get ready to commit, git says that db/schema.rb has
> changed. This is weird, and I think it's because I did a rake
> db:migrate.
>
> So my question is, what's the best practice relating to putting bits of
> the database (schema.rb and the databases themselves) into sourc
> control. And what's the best practice relating to running a rake
> db:migrate after a git checkout of a new branch?
>
> Anyone?
>
> - Pito
> --
> Posted viahttp://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to