by mistake i have deleted the contents of the db folder in an rails app. how do i recreate those db migration files? -- Posted via http://www.ruby-forum.com/.
On Aug 13, 9:01 am, Rails List <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> by mistake i have deleted the contents of the db folder in an rails app. > how do i recreate those db migration files?restore them from source control :-) if you just need the structure of the database then rake db:schema:dump will dump that. Fred> -- > Posted viahttp://www.ruby-forum.com/.
Frederick Cheung wrote:> On Aug 13, 9:01�am, Rails List <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> by mistake i have deleted the contents of the db folder in an rails app. >> how do i recreate those db migration files? > > restore them from source control :-) > > if you just need the structure of the database then rake > db:schema:dump will dump that. > > FredFred, thanks a lot. it has create the schema dump. if I do db:migrate, will it create all the tables using my current connection parameters? -- Posted via http://www.ruby-forum.com/.
On Aug 13, 4:13 am, Rails List <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Frederick Cheung wrote: > > On Aug 13, 9:01 am, Rails List <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > wrote: > >> by mistake i have deleted the contents of the db folder in an rails app. > >> how do i recreate those db migration files? > > > restore them from source control :-) > > > if you just need the structure of the database then rake > > db:schema:dump will dump that. > > > Fred > > Fred, thanks a lot. it has create the schema dump. if I do db:migrate, > will it create all the tables using my current connection parameters?Um... no? If you need to create a db according to the dumped schema (on another machine, I presume), you''d use "rake db:schema:dump". And you are using source control, right? I hope? --Matt Jones
Matt Jones wrote:> Um... no? If you need to create a db according to the dumped schema > (on another machine, I presume), you''d use "rake db:schema:dump".Matt, I assume you wanted to type: $ rake db:schema:load For the OP, more options: $ rake -T db:schema $ rake -T db $ rake -T You were given an awesome advice, use source control. It can improve your life quality immensely. BTW, if I would be asked which one, I''d say git. YMMV. -- Posted via http://www.ruby-forum.com/.
xy xy wrote:> Matt Jones wrote: >> Um... no? If you need to create a db according to the dumped schema >> (on another machine, I presume), you''d use "rake db:schema:dump". > > Matt, I assume you wanted to type: > > $ rake db:schema:load > > For the OP, more options: > > $ rake -T db:schema > $ rake -T db > $ rake -T > > You were given an awesome advice, use source control. It can improve > your life quality immensely. BTW, if I would be asked which one, I''d say > git. YMMV.Thanks for all the answers. I am yet to use source control. Although I am sure source control is useful, i haven''t found ( or i didn''t try hard enough :-)) any simple tutorial for learning to use git. -- Posted via http://www.ruby-forum.com/.
Rails List wrote:> Thanks for all the answers. I am yet to use source control. Although I > am sure source control is useful, i haven''t found ( or i didn''t try hard > enough :-)) any simple tutorial for learning to use git.Source control isn''t just useful. It saves lives. And RAILS_ROOT/db/* files. ;) You can pick your new favourite Git tutorial/book/screencast at http://git-scm.com/documentation -- Posted via http://www.ruby-forum.com/.