Issue #4868 - Adding warning message to db_connect when already connected
parent
603179176a
commit
187a0445f3
|
@ -1706,6 +1706,15 @@ class Db
|
||||||
|
|
||||||
def cmd_db_connect(*args)
|
def cmd_db_connect(*args)
|
||||||
return if not db_check_driver
|
return if not db_check_driver
|
||||||
|
if framework.db.connection_established?
|
||||||
|
cdb = ""
|
||||||
|
::ActiveRecord::Base.connection_pool.with_connection { |conn|
|
||||||
|
if conn.respond_to? :current_database
|
||||||
|
cdb = conn.current_database
|
||||||
|
end
|
||||||
|
}
|
||||||
|
return print_status("#{framework.db.driver} already connected to #{cdb}")
|
||||||
|
end
|
||||||
if (args[0] == "-y")
|
if (args[0] == "-y")
|
||||||
if (args[1] and not ::File.exists? ::File.expand_path(args[1]))
|
if (args[1] and not ::File.exists? ::File.expand_path(args[1]))
|
||||||
print_error("File not found")
|
print_error("File not found")
|
||||||
|
|
Loading…
Reference in New Issue