Skip to content
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