Repository: rails/rails
File: activerecord/lib/active_record/tasks/database_tasks.rb (Ruby)

Code before:
        flags = structure_load_flags_for(db_config.adapter)
        database_adapter_for(db_config, *arguments).structure_load(filename, flags)
      end

      def load_schema(db_config, format = db_config.schema_format, file = nil) # :nodoc:
        file ||= schema_dump_path(db_config, format)
        return unless file

        verbose_was, Migration.verbose = Migration.verbose, verbose? && ENV["VERBOSE"]
        check_schema_file(file)

        case format
        when :ruby
          load(file)
        when :sql
          structure_load(db_config, file)
        else
          raise ArgumentError, "unknown format #{format.inspect}"
        end

        migration_connection_pool.internal_metadata.create_table_and_set_flags(db_config.env_name, schema_sha1(file))
      ensure
        Migration.verbose = verbose_was
      end

      def schema_up_to_date?(configuration, file = nil)
        db_config = resolve_configuration(configuration)

        file ||= schema_dump_path(db_config)

        return true unless file && File.exist?(file)

        with_temporary_pool(db_config) do |pool|
          internal_metadata = pool.internal_metadata
          return false unless internal_metadata.enabled?
          return false unless internal_metadata.table_exists?

          internal_metadata[:schema_sha1] == schema_sha1(file)
        end
      end

      def reconstruct_from_schema(db_config, file = nil) # :nodoc:
        file ||= schema_dump_path(db_config, db_config.format)

        check_schema_file(file) if file

        with_temporary_pool(db_config, clobber: true) do
          if schema_up_to_date?(db_config, file)
            truncate_tables(db_config) unless ENV["SKIP_TEST_DATABASE_TRUNCATE"]
          else
            purge(db_config)

Review comment (suggestion):
This changes the method signature of a public method. It's probably better to rename `format` to `_` to explicitly mark it as unused, and submit a separate PR to remove the parameter as a potentially-breaking change.

Code after:
        flags = structure_load_flags_for(db_config.adapter)
        database_adapter_for(db_config, *arguments).structure_load(filename, flags)
      end

      def load_schema(db_config, format = db_config.schema_format, file = nil) # :nodoc:
        format = format.to_sym
        file ||= schema_dump_path(db_config, format)
        return unless file

        verbose_was, Migration.verbose = Migration.verbose, verbose? && ENV["VERBOSE"]
        check_schema_file(file)

        case format
        when :ruby
          load(file)
        when :sql
          structure_load(db_config, file)
        else
          raise ArgumentError, "unknown format #{format.inspect}"
        end

        migration_connection_pool.internal_metadata.create_table_and_set_flags(db_config.env_name, schema_sha1(file))
      ensure
        Migration.verbose = verbose_was
      end

      def schema_up_to_date?(configuration, _ = nil, file = nil)
        db_config = resolve_configuration(configuration)

        file ||= schema_dump_path(db_config)

        return true unless file && File.exist?(file)

        with_temporary_pool(db_config) do |pool|
          internal_metadata = pool.internal_metadata
          return false unless internal_metadata.enabled?
          return false unless internal_metadata.table_exists?

          internal_metadata[:schema_sha1] == schema_sha1(file)
        end
      end

      def reconstruct_from_schema(db_config, file = nil) # :nodoc:
        file ||= schema_dump_path(db_config, db_config.schema_format)

        check_schema_file(file) if file

        with_temporary_pool(db_config, clobber: true) do
          if schema_up_to_date?(db_config, nil, file)
            truncate_tables(db_config) unless ENV["SKIP_TEST_DATABASE_TRUNCATE"]
          else