The entire set of if/elsif code above can be eliminated by writing a single class method on DatabaseType that returns in types available for a database. e.g.

DatabaseType.get_available_types(db).each do |deploy_type|
...

Please rewrite this to eliminate this and the below block of if/elsif code from this Rake task.