连接ci数据库名修改,根据repo
This commit is contained in:
parent
ab3242569d
commit
ab4af170fb
|
@ -63,6 +63,7 @@ class Ci::BaseController < ApplicationController
|
||||||
if current.ci_cloud_account.server_type == Ci::CloudAccount::SERVER_TYPE_TRUSTIE
|
if current.ci_cloud_account.server_type == Ci::CloudAccount::SERVER_TYPE_TRUSTIE
|
||||||
connect_to_trustie_ci_database(options)
|
connect_to_trustie_ci_database(options)
|
||||||
else
|
else
|
||||||
|
options = options.merge(db_name: current.login)
|
||||||
connect_to_ci_database(options)
|
connect_to_ci_database(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ module Ci::DbConnectable
|
||||||
password: db_config[:password],
|
password: db_config[:password],
|
||||||
port: db_config[:port]
|
port: db_config[:port]
|
||||||
}
|
}
|
||||||
req_params = req_params.merge(database: "#{current_user.login}_#{db_config[:database]}") unless master_db === true
|
db_name = options[:db_name].blank? ? current_user.login : options[:db_name]
|
||||||
|
req_params = req_params.merge(database: "#{db_name}_#{db_config[:database]}") unless master_db === true
|
||||||
|
|
||||||
db_params = Ci::Database.get_connection_params(req_params)
|
db_params = Ci::Database.get_connection_params(req_params)
|
||||||
@connection = Ci::Database.set_connection(db_params).connection
|
@connection = Ci::Database.set_connection(db_params).connection
|
||||||
|
|
Loading…
Reference in New Issue