DiversitySamplingPlots provides tools to handle the basic parts of the database. These tools are only available for the owner of the database and should be handled with care as any changes in the database may disable the connection of your client to the database. Before changing any parts of the database it is recommended to backup the current state of the database. To use these tools, choose Administation - Database tools ... from the menu. A window will open as shown below.
The Description section (see above) shows the basic definitions of the objects in the database and enables you to enter a description for these objects.
In the Log table and trigger section (see below) click on the List tables button to see all tables within the database. The Table section shows the basic definitions of a selected table. If columns for logging the date and responsible user when inserting and updating the data are missing, you can use the Attach ... button to add these columns to the table.
In the Log table section (see below) you can create a logging table for the selected table in a format as used within the Diversity Workbench. Click on the Show SQL ... button to show the SQL-statement that will create the logging table. If an old logging table should be kept, choose the Keep old log table option. If your table should support the version setting from a main table, choose the Add the column LogVersion option. To finally create the logging table click on the Create LogTable ... button.
The triggers for insert, update and delete are created in the according sections (see below). If an old trigger exists, its definition will be shown in the upper part of the window. Click on the Show SQL button to see the definition of the trigger according to the current definition of the table in a format as used in the Diversity Workbench. To finally create the trigger, click on the Create trigger button. The update and delete triggers will transfer the original version of the data into the logging tables as defined above, where you can inspect the history of the data sets.
If so far no procedure for setting the version in a main table is defined, you can create this procedure in the last section. Click on the Show SQL button to see the definition and on the Create Procedure button to create the procedure (see below).
If you want to use replication within your module, the tables need certain columns and a log table. These preparations can be performed by a script, generated in the section Replication. Select the tables you want to include in the process and create the script. This script can then be included in an update of the database. Please ensure that these changes are only made by expert staff.