class RedmineInstaller::Database::MySQL

Public Instance Methods

adapter_name() click to toggle source
# File lib/redmine-installer/database.rb, line 128
def adapter_name
  'mysql2'
end
backup_command(file) click to toggle source
# File lib/redmine-installer/database.rb, line 149
def backup_command(file)
  "mysqldump --add-drop-database --compact --result-file=#{file} #{command_args} #{@database}"
end
command_args() click to toggle source
# File lib/redmine-installer/database.rb, line 132
def command_args
  args = []
  args << "--host=#{@host}"         unless @host.to_s.empty?
  args << "--port=#{@port}"         unless @port.to_s.empty?
  args << "--user=#{@username}"     unless @username.to_s.empty?
  args << "--password=#{@password}" unless @password.to_s.empty?
  args.join(' ')
end
create_database_command() click to toggle source
# File lib/redmine-installer/database.rb, line 141
def create_database_command
  "mysql #{command_args} --execute=\"create database #{@database}\""
end
default_port() click to toggle source
# File lib/redmine-installer/database.rb, line 124
def default_port
  3306
end
drop_database_command() click to toggle source
# File lib/redmine-installer/database.rb, line 145
def drop_database_command
  "mysql #{command_args} --execute=\"drop database #{@database}\""
end
restore_command(file) click to toggle source
# File lib/redmine-installer/database.rb, line 153
def restore_command(file)
  "mysql #{command_args} #{@database} < #{file}"
end