Class: ROM::Cassandra::Migrations::RunnerDown Private

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

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.

Rolls back the migration

Returns:

  • (undefined)


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

def apply
  migration.down
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)


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

Returns:

  • (Boolean)


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

def migrate?
  select_version.any?
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.

Removes the version from Cassandra db

Returns:

  • (Array)

    an empty array



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