def METHOD_NAME(root_directory):
    """Apply migrations to a project.
    This function identifies and performs all the necessary schema migrations
    to bring a project up to date with the current schema version of signac.
    The calling code does not require prior knowledge of the schema version of
    the project, and the function is idempotent when applied to projects that
    already have an up-to-date schema.
    Parameters
    ----------
    root_directory : str
        The path to the project to migrate.
    """
    try:
        lock = FileLock(os.path.join(root_directory, FN_MIGRATION_LOCKFILE))
        with lock:
            for (origin, destination), migrate in _collect_migrations(root_directory):
                try:
                    _print_err(
                        f"Applying migration for version {origin} to {destination}... ",
                        end="",
                    )
                    migrate(root_directory)
                except Exception as e:
                    raise RuntimeError(
                        f"Failed to apply migration {destination}."
                    ) from e
                else:
                    config = _CONFIG_LOADERS[destination](root_directory)
                    config["schema_version"] = destination
                    config.write()
                    _print_err("OK")
    finally:
        try:
            os.unlink(lock.lock_file)
        except FileNotFoundError:
            pass