]> projects.mako.cc - selectricity-live/blob - vendor/plugins/yaml_db/tasks/yaml_db_tasks.rake
referenced mailing list and gitorious
[selectricity-live] / vendor / plugins / yaml_db / tasks / yaml_db_tasks.rake
1 namespace :db do
2         desc "Dump schema and data to db/schema.rb and db/data.yml"
3         task(:dump => [ "db:schema:dump", "db:data:dump" ])
4
5         desc "Load schema and data from db/schema.rb and db/data.yml"
6         task(:load => [ "db:schema:load", "db:data:load" ])
7
8         namespace :data do
9                 def db_dump_data_file
10                         "#{RAILS_ROOT}/db/data.yml"
11                 end
12
13                 desc "Dump contents of database to db/data.yml"
14                 task(:dump => :environment) do
15                         YamlDb.dump db_dump_data_file
16                 end
17
18                 desc "Load contents of db/data.yml into database"
19                 task(:load => :environment) do
20                         YamlDb.load db_dump_data_file
21                 end
22         end
23 end

Benjamin Mako Hill || Want to submit a patch?