def _get_old_package_revision_license_ids(migrate_engine):
    """Returns a dict of old license ids, keyed by package_revision id."""
    old_ids = {}
    select_licenses = 'SELECT id, license_id FROM package_revision;'
    q = migrate_engine.execute(select_licenses)
    for id, license_id in q:
        old_ids[id] = license_id
    return old_ids
