Class: ROM::Cassandra::Migrations::RunnerDown Private
- Defined in:
- lib/rom/cassandra/migrations/runner_down.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.
Runs migration up, registers it in Cassandra table and logs the change.
Instance Attribute Summary
Attributes inherited from Runner
#logger, #migration, #path, #session, #version
Instance Method Summary collapse
-
#apply ⇒ undefined
private
Rolls back the migration.
-
#log ⇒ undefined
private
Logs the result of the operation.
-
#migrate? ⇒ Boolean
private
Checks if the version hasn't been registered yet.
-
#register ⇒ Array
private
Removes the version from Cassandra db.
Methods inherited from Runner
apply, #call, #initialize, #select_version
Constructor Details
This class inherits a constructor from ROM::Cassandra::Migrations::Runner
Instance Method Details
#apply ⇒ undefined
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.
Rolls back the migration
25 26 27 |
# File 'lib/rom/cassandra/migrations/runner_down.rb', line 25 def apply migration.down end |
#log ⇒ undefined
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.
Logs the result of the operation
41 42 43 |
# File 'lib/rom/cassandra/migrations/runner_down.rb', line 41 def log logger.info "Roll back migration #{version}\n" end |
#migrate? ⇒ Boolean
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.
Checks if the version hasn't been registered yet
17 18 19 |
# File 'lib/rom/cassandra/migrations/runner_down.rb', line 17 def migrate? select_version.any? end |
#register ⇒ Array
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.
Removes the version from Cassandra db
33 34 35 |
# File 'lib/rom/cassandra/migrations/runner_down.rb', line 33 def register session.call "DELETE FROM rom.migrations WHERE version = '#{version}';" end |