def load_database
      if dir_exists?
        config = {
          'adapter' => 'sqlite3',
          'database' => File.join(config_dir, DATABASE_FILE),
          'pool' => 5,
          'timeout' => 5000
        }

        begin
          ActiveRecord::Base.establish_connection(config)
          ActiveRecord::Migrator.migrate(File.join(File.dirname(__FILE__), \
            '../../db/migrate'), ENV['VERSION'] ? ENV['VERSION'].to_i : nil )

        rescue StandardError => e
          raise DatabaseAccessError, e.message
        end
      else
        raise ConfigDirMissingError, 'Config dir missing. Run init command'
      end
    end
def load_database
      if dir_exists?
        config = {
          'adapter' => 'sqlite3',
          'database' => File.join(config_dir, DATABASE_FILE),
          'pool' => 5,
          'timeout' => 5000
        }

        begin
          ActiveRecord::Base.establish_connection(config)
          ActiveRecord::Migrator.migrate(File.join(File.dirname(__FILE__), \
            '../../db/migrate'), ENV['VERSION'] ? ENV['VERSION'].to_i : nil )

        rescue StandardError => e
          raise DatabaseAccessError, e.message
        end
      else
        raise ConfigDirMissingError, 'Config dir missing. Run init command'
      end
    end
Loads the sqlite database.  If no database exists it will be created
 and the database migrations will be run.