Re: Implement the schema.rb for updating the database

coolesting
Sun, 21 Aug 2011 02:08:57 -0000

Thanks colin, the tutorail is very helpful to me.

2011/8/20 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

> On 20 August 2011 15:53, coolesting
<coolesting-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hi, guys
> >
> > I fix the db/schema.rb file, and want to update the database using it
.
> > How i should do. i try ''rake db:migrate'' but it not
works.
>
> You should not manually change schema.rb, you should instead write a
> migration to change the database design.  Running the migration will
> update schema.rb.
>
> See the Rails Guide on Migrations for how to do this.
>
> In order to put schema.rb back to what it should be before running the
> migrations you can do
> rake db:schema:dump
> You can alternatively just revert schema.rb using your Version Control
> System.  If you are not using a VCS then start doing so immediately,
> you will not regret it.  I prefer git.
>
> I assume you are just getting started with Rails so have a look at all
> the Rails Guides and work through some tutorials.  Make sure you are
> using Rails 3 and that the tutorial is for this version.
> railstutorial.org is good and is free to use online.
>
> Colin
>
> Colin
>
> --
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>