about summary refs log tree commit diff
path: root/lib/tasks/db.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/db.rake')
-rw-r--r--lib/tasks/db.rake14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index ca939fd1f..e8a64b8fb 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -4,16 +4,14 @@ namespace :db do
   namespace :migrate do
     desc 'Setup the db or migrate depending on state of db'
     task setup: :environment do
-      begin
-        if ActiveRecord::Migrator.current_version.zero?
-          Rake::Task['db:migrate'].invoke
-          Rake::Task['db:seed'].invoke
-        end
-      rescue ActiveRecord::NoDatabaseError
-        Rake::Task['db:setup'].invoke
-      else
+      if ActiveRecord::Migrator.current_version.zero?
         Rake::Task['db:migrate'].invoke
+        Rake::Task['db:seed'].invoke
       end
+    rescue ActiveRecord::NoDatabaseError
+      Rake::Task['db:setup'].invoke
+    else
+      Rake::Task['db:migrate'].invoke
     end
   end