Versioning

Overview

The versioning system allows the user to create snapshots of the database at a certain point in time. Afterwards you can take a look at that snapshot to see what data was in the database at that time.

There are two kind of snapshots possible in planop: private and public.

Making a public snapshot makes that information available to users that have the permission to see the publicised information, but not what is in the current working information.

The versioning system only stores the changes, which means every version is very lightweight. You are advised to store new versions often. A mechanism is present to automate the creation of versions (e.g. every night).

Details

There is a table with versions: info about when a version was made, by whom and whether it is public or not.

Other information is flagged whether or not something was changed since the last version.

The work information is part of a special work version.

When you save a version, only the modified information is stored. When you look at a version (e.g. a public version), you will see for each element the information as saved in that version OR from the last earlier version in which the element was saved.

This can be illustrated with the following schematics.

The database has a table with elements X, Y and Z. A version A was just created. It contains all elements (since it is the first version).

Work version X Y Z  
Version A X Y Z  

Let’s change element Y and add element W.

The database now contains: (an asterix marks info labelled as modified)

Work version X Y1* Z W*
Version A X Y Z  

We create a version B. It will contain the changed elements. They are no longer marked in the work version.

Work version X Y1 Z W
Version A X Y Z  
Version B   Y1   W

If we look at version B, for each element the lowest element is visible, that is:

look at B X Y1 Z W

Let’s change element Z.

Work version X Y1 Z1* W
Version A X Y Z  
Version B   Y1   W

Now make a version C:

Work version X Y1 Z1 W
Version A X Y Z  
Version B   Y1   W
Version C     Z1  

If we look at version C, we see for each column the lowest element:

look at C X Y1 Z1 W

Visible in B is for each column the element in B or the lowest above:

look at B X Y1 Z W

An element that gets deleted does not disappear, but gets a special deleted flag.

Items with this flag are present in the database, but never visible. When we create a version, the elements with the deleted flag end up in the version and are removed from the workversion.

In the following schematics, elements with the deleted flag are marked with a ‘-‘.

Let’s delete X:

Work version X- Y1 Z1 W
Version A X Y Z  
Version B   Y1   W
Version C     Z1  

If we look at the work version, X is no longer visible. However, looking at versions A, B or C, X is still visible.

Let’s create a version D.

Work version   Y1 Z1 W
Version A X Y Z  
Version B   Y1   W
Version C     Z1  
Version D X-      

Looking at D, we no longer see X (because it is carrying the deleted flag. We still see X in version C though.

Partial versioning

It is not necessary to include all the information in a version. Especially for public versions, it is interesting to be able to create a version that only includes a certain part of the database.

This can be explained with an example. Suppose you have two installations, A and B. You have made a public version of A and B, and now you are in working the scenarios in installation A because a project changing A is in its design stage.

Obviously, since the project is not finished yet, you don’t want the changes to be visible yet to public users.

In the meantime, some one points out an error in the information for installation B. You correct the error and want the public information to be corrected too, but without showing the changes in installation A.

In that case, you can create a new public version, only containing the changes in installation B.

Partial versioning is available via the publish buttons for following parts of the database:

  • substances and reactions;
  • installation overview (i.e. the installation tree with its sections, but without the scenario information);
  • a single scenario;
  • a section with its scenarios;
  • a suggestion list.

Mind that in certain circomstances, publishing is not available: e.g. you will not be able to publish a scenario if the section or scope of the scenario is not yet publicly visible.