Class: Hanami::Model::Migration Private
- Inherits:
-
Object
- Object
- Hanami::Model::Migration
- Defined in:
- lib/hanami/model/migration.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.
Database migration
Instance Attribute Summary collapse
- #gateway ⇒ Object readonly private
- #migration ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(gateway, &block) ⇒ Migration
constructor
private
A new instance of Migration.
- #run(direction = :up) ⇒ Object private
Constructor Details
#initialize(gateway, &block) ⇒ Migration
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.
Returns a new instance of Migration.
18 19 20 21 22 |
# File 'lib/hanami/model/migration.rb', line 18 def initialize(gateway, &block) @gateway = gateway @migration = gateway.migration(&block) freeze end |
Instance Attribute Details
#gateway ⇒ Object (readonly)
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.
10 11 12 |
# File 'lib/hanami/model/migration.rb', line 10 def gateway @gateway end |
#migration ⇒ Object (readonly)
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.
14 15 16 |
# File 'lib/hanami/model/migration.rb', line 14 def migration @migration end |
Instance Method Details
#run(direction = :up) ⇒ Object
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.
26 27 28 |
# File 'lib/hanami/model/migration.rb', line 26 def run(direction = :up) migration.apply(gateway.connection, direction) end |