Db folder is empty. how to regenerate?

by mistake i have deleted the contents of the db folder in an rails app.
how do i recreate those db migration files?

On Aug 13, 9:01 am, Rails L. [email protected]
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 :slight_smile:

if you just need the structure of the database then rake
db:schema:dump will dump that.

Fred

Frederick C. wrote:

On Aug 13, 9:01�am, Rails L. [email protected]
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 :slight_smile:

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?

On Aug 13, 4:13 am, Rails L. [email protected]
wrote:

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 J.

Matt J. 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.

xy xy wrote:

Matt J. 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.

Rails L. 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. :wink:

You can pick your new favourite Git tutorial/book/screencast at
http://git-scm.com/documentation