Collection Contents Previous Next PDF

UltraLite Database User's Guide

UltraLite Utilities Reference

The UltraLite Schema Painter

Managing schema files


When you first rename a table or column in your schema UltraLite stores the original name of the table or column. For example, if you create a table named cust, and later rename it to customer, cust is saved as the old name. If you then renamed the table a second time, to customer_info, the old name remains cust.

The scheme is designed so that a schema file can be used to alter the schema of an existing database. For example, assume that version one of your application shipped with a table named cust. As part of the changes for version two, you modify your version one schema file by renaming the table to customer. This automatically saves cust as the old name. If you now apply this schema file to a version one database file, UltraLite looks for a table named cust, the old name, and renames it Customer. The same applies to columns in a table.

It is therefore important for future compatibility that you clear the old names from a schema file after a schema file is deployed.

For more information, see Upgrading UltraLite database schemas.

To clear all of the old names in the schema file after deployment

  1. Open the schema file in the UltraLite Schema Painter.

  2. Choose File > Clear Upgrade Information.

This sets all of the old names for tables and columns to empty values. You can then safely edit your schema file for the next version of your application.

Manual renaming of object names 

Sometimes it may be desirable to manually alter the names of tables and columns. For example, you may have versions one and two of your application deployed and wish to create a single UltraLite schema file that can upgrade both versions one and two of this database to version three.

To manually change object names

  1. Open your schema in the UltraLite Schema Painter.

  2. Choose File > Export Schema for Palm.

You can use this feature to inspect the current old names in your schema. If you use ulxml, you can explicitly set the old name of tables and columns in the <table> and <column> XML elements.


Collection Contents Previous Next PDF