Class: Redmine::Installer::Plugin::Database::PostgreSQL
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
Returns a new instance of PostgreSQL.
156
157
158
159
|
# File 'lib/redmine-installer/plugins/database.rb', line 156
def initialize
super
@params.add('port').default(5432)
end
|
Class Method Details
.adapter_name ⇒ Object
152
153
154
|
# File 'lib/redmine-installer/plugins/database.rb', line 152
def self.adapter_name
'postgresql'
end
|
Instance Method Details
#command(comm, file) ⇒ Object
161
162
163
|
# File 'lib/redmine-installer/plugins/database.rb', line 161
def command(comm, file)
%{PGPASSWORD="#{get('password')}" #{comm} -i -h #{get('host')} -p #{get('port')} -U #{get('username')} -Fc -f #{file} #{get('database')}}
end
|
#command_for_backup(file) ⇒ Object
170
171
172
|
# File 'lib/redmine-installer/plugins/database.rb', line 170
def command_for_backup(file)
command('pg_dump', file)
end
|
#command_for_empty ⇒ Object
165
166
167
168
|
# File 'lib/redmine-installer/plugins/database.rb', line 165
def command_for_empty
''
end
|
#command_for_restore(file) ⇒ Object
174
175
176
|
# File 'lib/redmine-installer/plugins/database.rb', line 174
def command_for_restore(file)
command('psql', file)
end
|