# Buggy code
def _make_migrations(self, old_version):
    # ############### FILL THIS METHOD WITH THE REQUIRED ACTIONS ##############
    # VERSION 0.1
    if old_version is None:
        return

    if old_version < Version("1.14.0"):
        migrate_config_install(self.cache)

    if old_version < Version("1.13.0"):
        old_settings = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]

# Only for building cross compilation tools, 'os_target/arch_target' is the system for
# which the tools generate code
os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, Arduino]
arch_target: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]

# Rest of the settings are "host" settings:
# - For native building/cross building: Where the library/program will run.
# - For building cross compilation tools: Where the cross compiler will run.
os:
    Windows:
        subsystem: [None, cygwin, msys, msys2, wsl]
    WindowsStore:
        version: ["8.1", "10.0"]
    Linux:
    Macos:
        version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14"]
    Android:
        api_level: ANY
    iOS:
        version: ["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3", "11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
    watchOS:
        version: ["4.0", "4.1", "4.2", "4.3", "5.0", "5.1"]
    tvOS:
        version: ["11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
    FreeBSD:
    SunOS:
    Arduino:
        board: ANY
arch: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]
compiler:
    sun-cc:
        version: ["5.10", "5.11", "5.12", "5.13", "5.14"]
        threads: [None, posix]
        libcxx: [libCstd, libstdcxx, libstlport, libstdc++]
    gcc:
        version: ["4.1", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9",
                  "5", "5.1", "5.2", "5.3", "5.4", "5.5",
                  "6", "6.1", "6.2", "6.3", "6.4",
                  "7", "7.1", "7.2", "7.3",
                  "8", "8.1", "8.2"]
        libcxx: [libstdc++, libstdc++11]
        threads: [None, posix, win32] #  Windows MinGW
        exception: [None, dwarf2, sjlj, seh] # Windows MinGW
    Visual Studio:
        runtime: [MD, MT, MTd, MDd]
        version: ["8", "9", "10", "11", "12", "14", "15"]
        toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
                  v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp,
                  LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp,
                  LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2]
    clang:
        version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
                  "5.0", "6.0", "7.0",
                  "8"]
        libcxx: [libstdc++, libstdc++11, libc++]
    apple-clang:
        version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0"]
        libcxx: [libstdc++, libc++]

build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
"""
        self._update_settings_yml(old_settings)

        # MIGRATE LOCAL CACHE TO GENERATE MISSING METADATA.json
        _migrate_create_metadata(self.cache, self.out)

    if old_version < Version("1.12.0"):
        migrate_plugins_to_hooks(self.cache)

    if old_version < Version("1.0"):
        _migrate_lock_files(self.cache, self.out)

    if old_version < Version("0.25"):
        from conans.paths import DEFAULT_PROFILE_NAME

        default_profile_path = os.path.join(
            self.cache.conan_folder, PROFILES_FOLDER, DEFAULT_PROFILE_NAME
        )
        if not os.path.exists(default_profile_path):
            self.out.warn(
                "Migration: Moving default settings from %s file to %s"
                % (CONAN_CONF, DEFAULT_PROFILE_NAME)
            )
            conf_path = os.path.join(self.cache.conan_folder, CONAN_CONF)

            migrate_to_default_profile(conf_path, default_profile_path)

            self.out.warn("Migration: export_source cache new layout")
            migrate_c_src_export_source(self.cache, self.out)


# Traceback (ValueError)
Traceback (most recent call last):
File "build\venv\lib\site-packages\conans\model\ref.py", line 111, in loads
_, name, version, user, channel, revision, _ = ConanFileReference.sep_pattern.split(text)
ValueError: not enough values to unpack (expected 7, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build\venv\lib\site-packages\conans\client\command.py", line 377, in install
ref = ConanFileReference.loads(args.path_or_reference)
File "build\venv\lib\site-packages\conans\model\ref.py", line 114, in loads
"OpenCV/1.0.6@user/stable" % text)
conans.errors.ConanException: Wrong package recipe reference C:/Users/daniel/src/flow
Write something like OpenCV/1.0.6@user/stable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build\venv\lib\site-packages\conans\client\command.py", line 1579, in run
method(args[0][1:])
File "build\venv\lib\site-packages\conans\client\command.py", line 390, in install
install_folder=args.install_folder)
File "build\venv\lib\site-packages\conans\client\conan_api.py", line 93, in wrapper
return f(*args, **kwargs)
File "build\venv\lib\site-packages\conans\client\conan_api.py", line 580, in install
no_imports=no_imports)
File "build\venv\lib\site-packages\conans\client\manager.py", line 80, in install
installer.install(deps_graph, keep_build)
File "build\venv\lib\site-packages\conans\client\installer.py", line 302, in install
self._build(nodes_by_level, keep_build, root_node, graph_info)
File "build\venv\lib\site-packages\conans\client\installer.py", line 324, in _build
self._handle_node_cache(node, keep_build, processed_package_refs)
File "build\venv\lib\site-packages\conans\client\installer.py", line 404, in _handle_node_cache
assert node.prev, "PREV for %s is None" % str(pref)
AssertionError: PREV for Boost/1.68.0-16@velo3d/thirdparty:df18e90df1fedfd9db3e0852ce38a27c76c5a54b is None

ERROR: PREV for Boost/1.68.0-16@velo3d/thirdparty:df18e90df1fedfd9db3e0852ce38a27c76c5a54b is None

# Fixed code
def _make_migrations(self, old_version):
    # ############### FILL THIS METHOD WITH THE REQUIRED ACTIONS ##############
    # VERSION 0.1
    if old_version is None:
        return

    if old_version < Version("0.25"):
        from conans.paths import DEFAULT_PROFILE_NAME

        default_profile_path = os.path.join(
            self.cache.conan_folder, PROFILES_FOLDER, DEFAULT_PROFILE_NAME
        )
        if not os.path.exists(default_profile_path):
            self.out.warn(
                "Migration: Moving default settings from %s file to %s"
                % (CONAN_CONF, DEFAULT_PROFILE_NAME)
            )
            conf_path = os.path.join(self.cache.conan_folder, CONAN_CONF)

            migrate_to_default_profile(conf_path, default_profile_path)

            self.out.warn("Migration: export_source cache new layout")
            migrate_c_src_export_source(self.cache, self.out)

    if old_version < Version("1.0"):
        _migrate_lock_files(self.cache, self.out)

    if old_version < Version("1.12.0"):
        migrate_plugins_to_hooks(self.cache)

    if old_version < Version("1.13.0"):
        old_settings = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]

# Only for building cross compilation tools, 'os_target/arch_target' is the system for
# which the tools generate code
os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, Arduino]
arch_target: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]

# Rest of the settings are "host" settings:
# - For native building/cross building: Where the library/program will run.
# - For building cross compilation tools: Where the cross compiler will run.
os:
    Windows:
        subsystem: [None, cygwin, msys, msys2, wsl]
    WindowsStore:
        version: ["8.1", "10.0"]
    Linux:
    Macos:
        version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14"]
    Android:
        api_level: ANY
    iOS:
        version: ["7.0", "7.1", "8.0", "8.1", "8.2", "8.3", "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3", "11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
    watchOS:
        version: ["4.0", "4.1", "4.2", "4.3", "5.0", "5.1"]
    tvOS:
        version: ["11.0", "11.1", "11.2", "11.3", "11.4", "12.0", "12.1"]
    FreeBSD:
    SunOS:
    Arduino:
        board: ANY
arch: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]
compiler:
    sun-cc:
        version: ["5.10", "5.11", "5.12", "5.13", "5.14"]
        threads: [None, posix]
        libcxx: [libCstd, libstdcxx, libstlport, libstdc++]
    gcc:
        version: ["4.1", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9",
                  "5", "5.1", "5.2", "5.3", "5.4", "5.5",
                  "6", "6.1", "6.2", "6.3", "6.4",
                  "7", "7.1", "7.2", "7.3",
                  "8", "8.1", "8.2"]
        libcxx: [libstdc++, libstdc++11]
        threads: [None, posix, win32] #  Windows MinGW
        exception: [None, dwarf2, sjlj, seh] # Windows MinGW
    Visual Studio:
        runtime: [MD, MT, MTd, MDd]
        version: ["8", "9", "10", "11", "12", "14", "15"]
        toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
                  v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp,
                  LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp,
                  LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2]
    clang:
        version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
                  "5.0", "6.0", "7.0",
                  "8"]
        libcxx: [libstdc++, libstdc++11, libc++]
    apple-clang:
        version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0"]
        libcxx: [libstdc++, libc++]

build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
"""
        self._update_settings_yml(old_settings)

        # MIGRATE LOCAL CACHE TO GENERATE MISSING METADATA.json
        _migrate_create_metadata(self.cache, self.out)

    if old_version < Version("1.14.0"):
        migrate_config_install(self.cache)

    if old_version < Version("1.14.2"):
        _migrate_full_metadata(self.cache, self.out)