Working with SchemaScript

Schema Script is a simple, imperative way of specifying the changes to be made to the database schema.

A complete schema file (Data Dictionary), because of its size and complexity, can quickly become unwieldy and cumbersome to work with.

Schema Script simplifies the process of schema changes by allowing a user to specify only the changes to be made, as opposed to the complete schema.

To modify the database schema using Schema Script:

  1. BACKUP YOUR DATABASE
    It is highly recommended that you always backup your database before applying any schema changes.
  2. Edit the .SchemaEditor configuration file for your environment
  3. Create a schema script
    Use your favorite text or XML editor to create a Schema Script file. Refer to the Schema Script XML Reference for complete details on schema scripting.
  4. Preview the Schema Changes
    To preview the changes to be applied to the database, open a command line and use the -preview option to produce a difference report. For example:

    SchemaEditor.exe Default.SchemaEditor -preview

    The difference report will be saved to the file defined by the reportFile parameter in the .SchemaEditor file.
  5. Apply the changes to the database
    Open a command line, and use the -apply option to upgrade the database schema. For example:

    SchemaEditor.exe Default.SchemaEditor -apply

Note: Only adds and updates can be performed using SchemaScript. Deletes are not currently supported. When performing an add operation (such as addTable or addColumn), if that object already exists in the database, this object will be "skipped", and will not cause any database changes to be performed.

See Also

Working with SchemaEditor

Quick Start

.SchemaEditor files

Command Line Options

Working with a Data Dictionary

Next

SchemaScript Example

Working with SchemaScript