Class: Hanami::Model::Migrator::PostgresAdapter Private

Inherits:
Adapter
  • Object
show all
Defined in:
lib/hanami/model/migrator/postgres_adapter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

PostgreSQL adapter

Since:

  • 0.4.0

Constant Summary collapse

HOST =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

'PGHOST'.freeze
PORT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

'PGPORT'.freeze
USER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

'PGUSER'.freeze
PASSWORD =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

'PGPASSWORD'.freeze
DB_CREATION_ERROR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

'createdb: database creation failed. If the database exists, ' \
'then its console may be open. See this issue for more details: ' \
'https://github.com/hanami/model/issues/250'.freeze

Constants inherited from Adapter

Adapter::MIGRATIONS_TABLE, Adapter::MIGRATIONS_TABLE_VERSION_COLUMN

Instance Method Summary collapse

Methods inherited from Adapter

for, #initialize, #migrate, #rollback, #version

Constructor Details

This class inherits a constructor from Hanami::Model::Migrator::Adapter

Instance Method Details

#createObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0


33
34
35
36
37
# File 'lib/hanami/model/migrator/postgres_adapter.rb', line 33

def create
  set_environment_variables

  call_db_command('createdb')
end

#dropObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0


41
42
43
44
45
# File 'lib/hanami/model/migrator/postgres_adapter.rb', line 41

def drop
  set_environment_variables

  call_db_command('dropdb')
end

#dumpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0


49
50
51
52
53
# File 'lib/hanami/model/migrator/postgres_adapter.rb', line 49

def dump
  set_environment_variables
  dump_structure
  dump_migrations_data
end

#loadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0


57
58
59
60
# File 'lib/hanami/model/migrator/postgres_adapter.rb', line 57

def load
  set_environment_variables
  load_structure
end