def METHOD_NAME(cls, current_work_id, new_work_id, _test=False):
    oldb = get_db()
    rows_changed = 0
    rows_deleted = 0
    failed_deletes = 0
    # get records with old work_id
    # `list` used to solve sqlite cursor test
    rows = list(
        oldb.select(
            cls.TABLENAME,
            where="work_id=$work_id",
            vars={"work_id": current_work_id},
        )
    )
    for row in rows:
        where = " AND ".join(
            [f"{k}='{v}'" for k, v in row.items() if k in cls.PRIMARY_KEY]
        )
        try:
            # try to update the row to new_work_id
            t_update = oldb.transaction()
            oldb.query(
                f"UPDATE {cls.TABLENAME} set work_id={new_work_id} where {where}"
            )
            rows_changed += 1
            t_update.rollback() if _test else t_update.commit()
        except (UniqueViolation, IntegrityError):
            t_delete = oldb.transaction()
            # otherwise, delete row with current_work_id if failed
            oldb.query(f"DELETE FROM {cls.TABLENAME} WHERE {where}")
            rows_deleted += 1
            if _test or not cls.ALLOW_DELETE_ON_CONFLICT:
                t_delete.rollback()
            else:
                t_delete.commit()
            if not cls.ALLOW_DELETE_ON_CONFLICT:
                failed_deletes += 1
                rows_deleted -= 1
    return rows_changed, rows_deleted, failed_deletes