diff --git a/lib/tasks/db/fly.rake b/lib/tasks/db/fly.rake new file mode 100644 index 000000000..b75937bab --- /dev/null +++ b/lib/tasks/db/fly.rake @@ -0,0 +1,15 @@ +namespace :db do + desc "Change fly VM" + task :fly, [:app_name, :command, :detail] => :environment do |t, args| + if args[:app_name].nil? || args[:command].nil? || args[:detail].nil? + puts "Missing arguments. Call with bin/rails fly[APP_NAME,COMMAND,DETAIL]" + return + end + + if args[:command] == "swap" + Fly.new.change_db_swap(app: args[:app_name], swap: args[:detail].to_i) + else + puts "Unrecognized command #{args[:command]}" + end + end +end diff --git a/lib/tasks/prepare.rake b/lib/tasks/db/prepare.rake similarity index 91% rename from lib/tasks/prepare.rake rename to lib/tasks/db/prepare.rake index 4db34cea6..b167136d1 100644 --- a/lib/tasks/prepare.rake +++ b/lib/tasks/db/prepare.rake @@ -1,18 +1,4 @@ namespace :db do - desc "Change fly VM" - task :fly, [:app_name, :command, :detail] => :environment do |t, args| - if args[:app_name].nil? || args[:command].nil? || args[:detail].nil? - puts "Missing arguments. Call with bin/rails fly[APP_NAME,COMMAND,DETAIL]" - return - end - - if args[:command] == "swap" - Fly.new.change_db_swap(app: args[:app_name], swap: args[:detail].to_i) - else - puts "Unrecognized command #{args[:command]}" - end - end - desc "Setup database encryption and update credentials" task :setup_encryption, [:send_to_fly] => :environment do |t, args| args.with_defaults(send_to_fly: false)