class ActiveRecord::SchemaDumper

def tables(stream)

def tables(stream)
  sorted_tables = @connection.tables.sort
  sorted_tables.each do |table_name|
    table(table_name, stream) unless ignored?(table_name)
  end
  # dump foreign keys at the end to make sure all dependent tables exist.
  if @connection.supports_foreign_keys?
    sorted_tables.each do |tbl|
      foreign_keys(tbl, stream) unless ignored?(tbl)
    end
  end
end