I have to make a program which changes the UI version number of a list item (the version number which is shown on the web interface of SharePoint).
For example:
There are these version for an item: 1.0, 1.1, 1.2, 2.0, 2.2, 2.3
I want to change the label of 2.2 version to 2.1.
As I know it is impossible through the Object Model, so I have to modify the database directly.
In the database there are two related tables:
-
AllDocs – In this table there are rows which describe the current versions of the document.
-
AllDocVersions – In this table there are rows which describe the other (not current) versions of the document.
It is not so difficult if I don’t have to change the current version, only I change the UIversion field in the right tables. (In the example: 2.2 to 2.1)
The problem is if the version change changes the current version. In the example: 2.2 to 2.4.
In this case I should move the record of version 2.2 from the AllDocVersions table to the AllDocs, and the record of version 2.3 from AllDocs to AllDocVersions, but the structure of these two tables are not identical.
Can anyone describe how I can fill the missing fields in these tables?
Can anyone suggest any other way for the version change?
One, not so easy solution could be:
v2.2asv2.4. It does two things for you:v2.2fromAllDocVersionstoAllDocsasv2.4andv2.3fromAllDocstoAllDocVersions.v2.2.v2.4tov2.5,v3.0etc. in the database directly with SQL UPDATE statement(s) ifv2.4is not the desired version number.