Skip to content

Allow overriding system user on db create. #2261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: release70
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ def initialize(config)
end

def create
system_username = ENV["ORACLE_SYSTEM_USER"] || "SYSTEM"
$stdout.puts "System user: '#{system_username}' (set ORACLE_SYSTEM_USER to override)" unless ENV["ORACLE_SYSTEM_USER"]

system_password = ENV.fetch("ORACLE_SYSTEM_PASSWORD") {
print "Please provide the SYSTEM password for your Oracle installation (set ORACLE_SYSTEM_PASSWORD to avoid this prompt)\n>"
print "Please provide the '#{system_username}' password for your Oracle installation (set ORACLE_SYSTEM_PASSWORD to avoid this prompt)\n>"
$stdin.gets.strip
}
establish_connection(@config.merge(username: "SYSTEM", password: system_password))
establish_connection(@config.merge(username: system_username, password: system_password))
begin
connection.execute "CREATE USER #{@config[:username]} IDENTIFIED BY #{@config[:password]}"
rescue => e
Expand Down