method

reconstruct_from_schema

reconstruct_from_schema(db_config, file = nil)
public

No documentation available.

# File activerecord/lib/active_record/tasks/database_tasks.rb, line 412
      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
            purge(db_config)
            load_schema(db_config, db_config.schema_format, file)
          end
        rescue ActiveRecord::NoDatabaseError
          create(db_config)
          load_schema(db_config, db_config.schema_format, file)
        end
      end