Class: Redmine::Installer::Plugin::Database::PostgreSQL
- Inherits:
-
Redmine::Installer::Plugin::Database
- Object
- Base
- Redmine::Installer::Plugin::Database
- Redmine::Installer::Plugin::Database::PostgreSQL
- Defined in:
- lib/redmine-installer/plugins/database.rb
Overview
PostgreSQL
Constant Summary
Constants inherited from Redmine::Installer::Plugin::Database
DATABASE_BACKUP_DIR, DATABASE_YML_PATH
Instance Attribute Summary
Attributes inherited from Redmine::Installer::Plugin::Database
Class Method Summary collapse
Instance Method Summary collapse
- #command(comm, file) ⇒ Object
- #command_for_backup(file) ⇒ Object
- #command_for_restore(file) ⇒ Object
-
#initialize ⇒ PostgreSQL
constructor
A new instance of PostgreSQL.
Methods inherited from Redmine::Installer::Plugin::Database
#backup, backup_all, #build, #file_for_backup, #get, #load, load_all, #make_config, #restore, restore_all
Methods inherited from Base
Methods included from Utils
Constructor Details
#initialize ⇒ PostgreSQL
Returns a new instance of PostgreSQL.
149 150 151 152 |
# File 'lib/redmine-installer/plugins/database.rb', line 149 def initialize super @params.add('port').default(5432) end |
Class Method Details
.adapter_name ⇒ Object
145 146 147 |
# File 'lib/redmine-installer/plugins/database.rb', line 145 def self.adapter_name 'pg' end |
Instance Method Details
#command(comm, file) ⇒ Object
154 155 156 |
# File 'lib/redmine-installer/plugins/database.rb', line 154 def command(comm, file) %{PGPASSWORD="#{get('password')}" #{comm} -i -h #{get('host')} -p #{get('port')} -U #{get('username')} -Fc -f #{file}} end |
#command_for_backup(file) ⇒ Object
158 159 160 |
# File 'lib/redmine-installer/plugins/database.rb', line 158 def command_for_backup(file) command('pg_dump', file) end |
#command_for_restore(file) ⇒ Object
162 163 164 |
# File 'lib/redmine-installer/plugins/database.rb', line 162 def command_for_restore(file) command('psql', file) end |