From ca4478bbf4f2ec3419821b4aa76eac04633ceda6 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Tue, 15 Sep 2009 05:02:37 -0500 Subject: [PATCH] Added reset_and_populate rake task. --- README | 4 +++- db_populate.gemspec | 4 ++-- tasks/populate.rake | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README b/README index d341194..97610ff 100644 --- a/README +++ b/README @@ -51,13 +51,15 @@ and re-run the task. db_populate rake tasks ====================== -db_populate includes two rake tasks: +db_populate includes three rake tasks: rake db:populate loads all of the data for the current environment rake db:migrate_and_populate is the same as calling rake db:migrate followed by rake db:populate +rake db:reset_and_populate is the same as calling rake db:reset followed by rake db:populate History ======= +2009-09-15 Add db:reset_and_populate task 2009-05-17 Fix typo in README 2009-03-21 Patch from Ahmed El-Daly to allow PKs with names other than id 2008-10-11 Initial release \ No newline at end of file diff --git a/db_populate.gemspec b/db_populate.gemspec index b9d9796..d403a8f 100644 --- a/db_populate.gemspec +++ b/db_populate.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = "db_populate" - s.version = "0.2.3" - s.date = "2009-05-17" + s.version = "0.2.4" + s.date = "2009-09-15" s.summary = "Seed data populator for Rails" s.email = "MikeG1@larkfarm.com" s.homepage = "http://github.com/ffmike/db-populate/tree/master" diff --git a/tasks/populate.rake b/tasks/populate.rake index d4306e4..a94235b 100644 --- a/tasks/populate.rake +++ b/tasks/populate.rake @@ -18,4 +18,9 @@ namespace :db do task :migrate_and_load => [ 'db:migrate', 'db:populate' ] + desc "Drop and reset the database for the current environment and then load seed data" + task :reset_and_populate => [ 'db:reset', 'db:populate'] + + task :reset_and_load => [ 'db:reset', 'db:populate'] + end \ No newline at end of file