Class: Redmine::Installer::Plugin::Database::MySQL
Overview
Constant Summary
DATABASE_BACKUP_DIR, DATABASE_YML_PATH
Instance Attribute Summary
#params
Class Method Summary
collapse
Instance Method Summary
collapse
#backup, backup_all, #build, #file_for_backup, #get, #load, load_all, #make_config, #restore, restore_all
Methods inherited from Base
all, inherited, title
Methods included from Utils
included
Constructor Details
#initialize ⇒ MySQL
Returns a new instance of MySQL.
125
126
127
128
|
# File 'lib/redmine-installer/plugins/database.rb', line 125
def initialize
super
@params.add('port').default(3306)
end
|
Class Method Details
.adapter_name ⇒ Object
121
122
123
|
# File 'lib/redmine-installer/plugins/database.rb', line 121
def self.adapter_name
'mysql2'
end
|
Instance Method Details
#command_args ⇒ Object
130
131
132
|
# File 'lib/redmine-installer/plugins/database.rb', line 130
def command_args
"-h #{params['host'].value} -P #{get('port')} -u #{get('username')} -p#{get('password')} #{get('database')}"
end
|
#command_for_backup(file) ⇒ Object
138
139
140
|
# File 'lib/redmine-installer/plugins/database.rb', line 138
def command_for_backup(file)
"mysqldump --add-drop-database #{command_args} > #{file}"
end
|
#command_for_empty ⇒ Object
134
135
136
|
# File 'lib/redmine-installer/plugins/database.rb', line 134
def command_for_empty
"mysql #{command_args} -e 'drop database #{get('database')}; create database #{get('database')};'"
end
|
#command_for_restore(file) ⇒ Object
142
143
144
|
# File 'lib/redmine-installer/plugins/database.rb', line 142
def command_for_restore(file)
"mysql #{command_args} < #{file}"
end
|