[DBCleaner] Error on deleting an espace version because of the Pending_Version_Id column

[DBCleaner] Error on deleting an espace version because of the Pending_Version_Id column

Forge Component
Published on 16 Aug by Mika Roivainen
28 votes
Published on 16 Aug by Mika Roivainen
Hello Ricardo,
I was using your component to delete old eSpace versions with the Prune Old ESpaces screen when I got an error trying to delete an espace version of an eSpace that is deleted and have in the Pending_Version_Id column the Id of the version that was being deleted.
I don’t know the meaning of the Pending_Version_Id column in the ossys_Espace Entity in order to suggest an action.
I would appreciate your suggestion to resolve this, thanks.
Error Detail in servicecenter:
The DELETE statement conflicted with the REFERENCE constraint "OSFRK_ossys_espace_OSSYS_ESPACE_VERSION_PENDING_VERSION_ID". The conflict occurred in database "<DATABASENAME>", table "dbo.ossys_Espace", column 'PENDING_VERSION_ID'. The statement has been terminated.
at OutSystems.HubEdition.RuntimePlatform.DBHelper.#cab(DbException e, IDbTransaction trans)
at OutSystems.HubEdition.RuntimePlatform.DBHelper.ExecuteNonQueryDontCleanParameters(IDbCommand cmd, String description, Boolean isApplication, Boolean skipLog)
at ssDBCleaner.ExtendedActions.DeleteEspace_Version(HeContext heContext, Int32 inParamId)
at ssDBCleaner.Actions.ActionDeleteESpaceVersion(HeContext heContext, Int32 inParamEspaceVersionId, Boolean& outParamSuccess)
Miguel Oliveira

That may be in that state due to a publishing error. Please check your database which eSpace has a non-null pending version id and republish it, or publish the latest uploaded version for this eSpace (which should be the one that's pending publication).

Best regards,
Ricardo Silva

The espace in question was deleted, so I couldn't publish the latest uploaded version for this eSpace, what I did was updated the value of the Pending_Version_Id column to null and I was able to delete the espace version with the DBCleaner.

Miguel Oliveira