Overview

When using a local database instance for each developer, there is a need to make sure the database is up to date structurally. Most team providers will update the DBI files that store the database metadata, but these providers do not actually change the database. Changing the database is done in Servoy using Servoy's toolset. Servoy will modify the database, and also alert the developer if there is changes that require developer intervention.  Changes are considered at the table level and at the column level.

DBI Files

DBI Files are JSON files that contain meta data about the tables and columns in a database.

To view exactly what is in a DBI file:

  1. Open the Resource perspective.
  2. Expand the Resource project and right-click the desired file. From the contextual popup, select Open With > Text Editor and view the resource as a JSON file.

Syncing DBI Files with the Local Database

There are a couple of Servoy Developer features used for changing the local database.

Synchronize With Database Wizard

The synchronize with database wizard will allow creation and deletion of tables in database based on DBI file information. It will also create columns associated with these tables.
 
To launch the wizard:

  1. In the Solution Explorer, right click on one of the following:
    1. The resources project
    2. The database servers node under the resources project
    3. The desired database under the database servers node
  2. Select Synchronize with DB server information.
  3. A wizard will appear. Walk through the wizard to update the databases

Problems Tab Quick Fix

Unfortunately, the wizard will not fix any differences with existing tables in the database. Any differences between the DBI files and the local database will show up in the Problems tab, and these differences can be fixed using the Quick Fix menu option.
To use the Problems tab:

  1. Find the error in the Problems tab indicating that the DBI file is out of sync with the database. Right-click the error and from the contextual popup, select Quick Fix
  2. The quick fix dialog will appear. There are normally two options: to change the DBI file or to change the local database. Depending on which is correct, make the appropriate selection and click Finish.
  3. Note that if there are similar errors, you may choose to do the same action across all error of the same type. This will be the default behavior, but if you want just one or a few, you may clear the checkboxes in the problems list before clicking Finish.
  4. In the problems list, if there are new tables that have not been synced yet, you may see a warning indicated the table does not exist in the database. You may use Quick Fix to open the synchronize with database wizard as well.

Some Notes about Team Development and Database Synchronization