Search code examples
rubydatabaseruby-on-rails-4yamldata-dump

data:dump a selected table Yamldb


I have been using YamlDb to save the state of my database. And use the rake task to dump the contents of Rails database to db/data.yml

rake db:data:dump

I also use the rake task to load the contents of db/data.yml into the database at times.

rake db:data:load

I am not sure if this has been asked before, but is there anyway to Dump one or two selected tables as oppose to the entire DB? if so how?


Solution

  • If anyone wants to be able to dump/load individual tables with yaml_db on Rails 4.

    You can use this gem

    gem 'yaml_db', :git => 'git://github.com/ballin22s/yaml_db.git'