class Brillo::Adapter::Base

Attributes

config[R]

Public Class Methods

new(db_config) click to toggle source
# File lib/brillo/adapter/base.rb, line 7
def initialize(db_config)
  @config = db_config
end

Public Instance Methods

dump_structure_and_migrations(config) click to toggle source
# File lib/brillo/adapter/base.rb, line 22
def dump_structure_and_migrations(config)
  # Overrides the path the structure is dumped to in Rails >= 3.2
  ENV['SCHEMA'] = ENV['DB_STRUCTURE'] = config.dump_path.to_s
  Rake::Task["db:structure:dump"].invoke
end
header() click to toggle source
# File lib/brillo/adapter/base.rb, line 10
def header
  ActiveRecord::Base.connection.dump_schema_information
end
load_command() click to toggle source
# File lib/brillo/adapter/base.rb, line 28
def load_command
  raise NotImplementedError
end
recreate_db() click to toggle source
# File lib/brillo/adapter/base.rb, line 32
def recreate_db
  ["db:drop", "db:create"].each do |t|
    logger.info "Running\n\trake #{t}"
    Rake::Task[t].invoke
  end
end