Improve the logic for versioning Invenio records
In the logic of the Invenio publishing task, we need to change how we check if we ever published something with the same (Source, Record ID):
Look for every archive with the same (Source, Record ID), removing last(). For the first one with Invenio_version != 0 or Parent_id existing -> then it's published