Class: ROM::Cassandra::Migrations::RunnerUp Private
- Defined in:
- lib/rom/cassandra/migrations/runner_up.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
Moves the migration forward.
-
#log ⇒ undefined
private
Logs the result of the operation.
-
#migrate? ⇒ Boolean
private
Checks if the version has been registered yet.
-
#register ⇒ Array
private
Registers the version in 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.
Moves the migration forward
25 26 27 |
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 25 def apply migration.up 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
42 43 44 |
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 42 def log logger.info "Apply 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 has been registered yet
17 18 19 |
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 17 def migrate? select_version.empty? 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.
Registers the version in Cassandra db
33 34 35 36 |
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 33 def register session.call "INSERT INTO rom.migrations (version)" \ " VALUES ('#{version}');" end |