Class: ROM::Cassandra::Migrations::RunnerUp Private

Inherits:
Runner
  • Object
show all
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

Methods inherited from Runner

apply, #call, #initialize, #select_version

Constructor Details

This class inherits a constructor from ROM::Cassandra::Migrations::Runner

Instance Method Details

#applyundefined

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

Returns:

  • (undefined)


25
26
27
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 25

def apply
  migration.up
end

#logundefined

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

Returns:

  • (undefined)


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

Returns:

  • (Boolean)


17
18
19
# File 'lib/rom/cassandra/migrations/runner_up.rb', line 17

def migrate?
  select_version.empty?
end

#registerArray

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

Returns:

  • (Array)

    an empty array



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