module ActiveRecord::Tasks::DatabaseTasks

def schema_dump_path(db_config, format = ActiveRecord.schema_format)

def schema_dump_path(db_config, format = ActiveRecord.schema_format)
  return ENV["SCHEMA"] if ENV["SCHEMA"]
  filename = db_config.schema_dump(format)
  return unless filename
  if File.dirname(filename) == ActiveRecord::Tasks::DatabaseTasks.db_dir
    filename
  else
    File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, filename)
  end
end