Using rake to dump and load the database

How can I specify the directory to upload / download my db in yaml?

rake db:data:dump_dir 

created

 db/2011-08-31_14:10:57_+0100/ 

and

 rake db:data:load_dir No such file or directory - <RAILS_ROOT>/db/base 

My question is, is it possible to specify a directory name for reset / boot and how?

thanks

+6
source share
1 answer

You can use the 'dir' parameter, for example:

 rake db:data:dump_dir dir="my_dir" 

which will put it in 'db / my_dir' and:

 rake db:data:load_dir dir='my_dir' 

which will load it from 'db / my_dir'.

For dumping, the directory must NOT exist. In both cases, dirs refer to db, absolute paths are NOT allowed

Hope this helps.

+11
source

Source: https://habr.com/ru/post/896321/


All Articles