Version Control
Last updated 27/02/2023
How Versioning Works in Five
Out of the box, Five has version control. This method is used to track changes made to your application you are developing in Five, it gives you full capability to restore a previous state and ensures no records are permanently deletedRestore a Record
1. Select a record in the list.2. Click the History clock in the form app bar.
Figure 1 - History button
3. Click a previous state on the timeline.
info
In the image below the title has been changed, and we can see 'jo' made this change.
4. Click the Edit button in the form app bar.
Figure 2 - Restore or edit from a previous state
info
You have the ability to make any changes from the current selected state.
5. Click the Save button in the form app bar.
Figure 3 - Save button
Version Control in Your Application
By default, applications built in Five also have this feature. For every table you create in Five, a history table is automatically created to store these changes, this will ensure no records are permanently deleted and previous states can be restored. Five has default settings configured for your history tables if you wish to use this feature. On the Application form, you have access to the Versioning tab which will display the Versioning page. All fields on the Versioning form can be edited.Figure 4 - Versioning fields
The table below explains the fields on the Versioning form.
Field | Default Setting | Description |
---|---|---|
Enable Versioning | true | This will allow for a full set of history tables to be created. |
History Table Prefix /Suffix | Suffix: _ | At least one of these fields is mandatory for versioning so Five can duplicate your table schema with the table name and the prefix, suffix, or both and store all versions of a record in the history table. For example, if you had a table called Customer, by using the underscore suffix there will now be two versions of the table in the database shown: Customer and Customer_. The Customer table will be the main table and hold the latest version of each record, while the Customer_ table will be the history table and will hold all versions of the record. |
Version Key Field Default | iVersionKey | This field will be the name of the column in the history table that will hold the primary key (Globally Unique Identifier, GUID) to uniquely identify each version of the record. |
Last  User Field Default | iLastUserKey | This field will be the name of the column in the history table that stores the GUID associated with the user who last performed changes, and the user’s name will be available in the history timeline. |
Record  Action Field Default | RecordAction | This field stores the action that was performed: C – Create, U – Update, or D - Delete. |
Record  Date Field Default | RecordDate | This field is to define the column to store the date/time of when the modifications occurred to be available on the history timeline. Database format - RFC 3339 (2019-10-12 07:20:50.52z) |
Disable Versioning
1. Select the Application record in the list.2. Click the Versioning tab.
3. Click the Enable Versioning switch.
4. Click the Save button in the form app bar.
Figure 5 - Disable versioning
caution
You will not be able to restore data in your application with the Enable Versioning switch set to false.