Skip to content

Commit

Permalink
Show supported DBs first in rails new --help
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Aug 2, 2016
1 parent 88cdecc commit 31c1ed9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions railties/lib/rails/generators/app_base.rb
Expand Up @@ -10,7 +10,7 @@
module Rails
module Generators
class AppBase < Base # :nodoc:
DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver )
DATABASES = %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver )
JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )
DATABASES.concat(JDBC_DATABASES)

Expand Down Expand Up @@ -266,12 +266,12 @@ def rails_version_specifier(gem_version = Rails.gem_version)
end

def gem_for_database
# %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
# %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
case options[:database]
when "oracle" then ["ruby-oci8", nil]
when "mysql" then ["mysql2", [">= 0.3.18", "< 0.5"]]
when "postgresql" then ["pg", ["~> 0.18"]]
when "oracle" then ["ruby-oci8", nil]
when "frontbase" then ["ruby-frontbase", nil]
when "mysql" then ["mysql2", [">= 0.3.18", "< 0.5"]]
when "sqlserver" then ["activerecord-sqlserver-adapter", nil]
when "jdbcmysql" then ["activerecord-jdbcmysql-adapter", nil]
when "jdbcsqlite3" then ["activerecord-jdbcsqlite3-adapter", nil]
Expand All @@ -284,9 +284,9 @@ def gem_for_database
def convert_database_option_for_jruby
if defined?(JRUBY_VERSION)
case options[:database]
when "oracle" then options[:database].replace "jdbc"
when "postgresql" then options[:database].replace "jdbcpostgresql"
when "mysql" then options[:database].replace "jdbcmysql"
when "oracle" then options[:database].replace "jdbc"
when "sqlite3" then options[:database].replace "jdbcsqlite3"
end
end
Expand Down

0 comments on commit 31c1ed9

Please sign in to comment.