def METHOD_NAME(tmp_path):
    """Test the schema is in-sync with the ``psql_dos`` backend, when migrating an old archive to the latest version."""
    # note, directly using the global profile's engine here left connections open
    with create_sqlalchemy_engine(get_profile().storage_config).connect() as conn:
        psql_insp = inspect(conn)
        # migrate an old archive
        filepath_archive = get_archive_file('export_0.4_simple.aiida', 'export/migrate')
        migrate(filepath_archive, tmp_path / 'archive.aiida', get_schema_version_head())
        # extract the database
        with tmp_path.joinpath('archive.sqlite').open('wb') as handle:
            extract_file_in_zip(tmp_path / 'archive.aiida', 'db.sqlite3', handle)
        engine = utils.create_sqla_engine(tmp_path / 'archive.sqlite')
        sqlite_insp = inspect(engine)
        diffs = diff_schemas(psql_insp, sqlite_insp)
        if diffs:
            raise AssertionError(f'Schema is not in-sync with the psql backend:\n{yaml.safe_dump(diffs)}')