method

load_schema

load_schema(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = env)
public

No documentation available.

# File activerecord/lib/active_record/tasks/database_tasks.rb, line 226
      def load_schema(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = env) # :nodoc:
        file ||= schema_file(format)

        check_schema_file(file)
        ActiveRecord::Base.establish_connection(configuration)

        case format
        when :ruby
          load(file)
        when :sql
          structure_load(configuration, file)
        else
          raise ArgumentError, "unknown format #{format.inspect}"
        end
        ActiveRecord::InternalMetadata.create_table
        ActiveRecord::InternalMetadata[:environment] = environment
      end