module Cassie::Schema::Configuration

Extend a module/class with Configuration to enable migration management

Attributes

schema_keyspace[RW]

The keyspace in which to store Cassie schema data

versions_table[RW]

The table in which to store Cassie schema applied versions data

Public Class Methods

extended(extender) click to toggle source

@!visibility private

# File lib/cassie/schema/configuration.rb, line 13
def self.extended(extender)
  extender.paths[:schema_file] = "db/cassandra/schema.rb"
  extender.paths[:migrations_directory] = "db/cassandra/migrations"
  extender.schema_keyspace = "cassie_schema"
  extender.versions_table = "versions"
end

Public Instance Methods

paths() click to toggle source

Paths used for configuration loading.

@return [Hash]

* +:schema_file+ - The .rb file defining the current schema structure
* +:migrations_directory+ - The directory containing the versioned schema migration .rb files
# File lib/cassie/schema/configuration.rb, line 25
def paths
  @paths ||= {}.with_indifferent_access
end

Protected Instance Methods

root() click to toggle source
# File lib/cassie/schema/configuration.rb, line 31
def root
  Pathname.new(Dir.pwd)
end