Applying a template to a database to update the schema

Use the Update Database Schema dialog to apply a template generated from one database to update the schema of another. This is useful when you have a group of databases which you need to keep consistent in their design and content.

About this task

The template must be compatible with the current database. This typically requires that the target database will have been created from a template generated by the source database, or by the same template as the source database.

Note: To update a database schema you will need permissions to:
  • create a template file in the iBaseTemplates folder – as specified in the Advanced page of the Options dialog
  • create a database in the same folder as the main database .idb file
The schema update process

To create a group of databases with a fully consistent design, you should do the following:

  1. In iBase, define a group of folder objects in the Common Folder Objects dialog that you want as a core set of folder objects across a number of databases. You can, if required, view or edit an object (such as a query or browse definition) to test that it is the one required or update it, before making it common.

    Sets cannot be defined as common folder objects as they refer to specific records in the database, which will not exist in other databases.

  2. In iBase Designer, make any other changes to the schema that you want to apply to the databases, such as adding or modifying entity and link types, or editing fields.
  3. Generate the template.
  4. Use Schema Update to apply the template to each database in turn. The common folder objects will be synchronized between the source database and target database, that is, the result of the update will be that the same set of folder objects exists in both databases.
What is updated?
The following elements are updated in the schema:
  • Entity types, link types, fields and standard fields
  • Datasheets
  • Pick lists, icon lists and SCC lists
  • Common folder objects, such as report definitions, queries, charting schemes and so on (but not sets or labeling schemes). Common folder objects are defined in iBase User. For more help, see the iBase help topic Defining Common Folder Objects.

Updating a schema can result in data being removed from the target database. Removing entity or link types will result in the loss of any data stored using these types. Data will also be lost when you remove fields. Ensure that you check the Deletions page of the Update Report carefully before proceeding with the update.

Procedure

To select a template:
  1. From the Tools > Database Design > Update Database Schema.
  2. Click Browse and select the template file.
    If the selected template is incompatible for any reason with the database, then an error message is displayed.
  3. If the template is compatible, then the two schemas are compared and the differences between them are displayed in the Update Report area of the dialog.

    Before updating the schema, you should review any differences between the schema and the template displayed in the Update Report area. The changes are organized into two pages: the Additions and Modifications and Deletions pages.

    Note: Once a template is selected, it can be viewed by clicking Open. The database entity and link types and fields defined for each type are displayed. You cannot edit the types or fields in this dialog.
  4. On the Additions and Modifications page and the Deletions page, review the changes that are listed.
    Any changes, additions or deletions to the following are listed:
    • Entity types and their fields
    • Link types and their fields
    • Standard fields
    • Datasheets
    • Pick lists, icon lists and SCC lists
    • Common folder objects (listed separately for each type of folder object)
    • Semantic Type Library (but specific changes are not listed)
    Note: If required, click Export to save a list of the schema changes in a text file that you can print later.
  5. When you are ready to apply the changes, click Update.
    When this is finished, you are warned if any folder objects were renamed because they have the same name as a common folder object in the template. Objects which are renamed will have an underscore added as a prefix. For more help on common folder objects, refer to the iBase help topic Defining Common Folder Objects.
  6. A confirmation message is displayed. Click Yes to proceed.

Results

When the update is completed, a message is displayed and the Update Database Schema dialog will close automatically.