Skip to main content

The Model Loader

Introduction

The Model Loader can be used to import data models between Cinchy instances. For example, if you have a DEV environment and make a change to a table design (ex: changing a column name), you can export and deploy your data model to a PROD environment and Cinchy will intelligently consolidate and merge the schema changes to adhere to the latest version.

info

The Model Loader does not import the actual data, just the model (ex: table column names, views, filters, etc.)

To import more than one data model, or to import it together with things such as queries, reference data, etc., use the Cinchy DXD tool.

Ensure that the import environment has access to any applicable reference data (such as that needed for linked columns).

Prerequisites

To successfully run the model loader you need to ensure that:

  • You have the “Can Design Tables” permission checked within the [Cinchy].[Users] table.
  • You have the “Design Table” permission checked within the Data Controls tab of your table.
  • You have the “Insert Rows” permission checked within the Data Controls tab of the [Cinchy].[Models] table. Note that each time you import a model (a new or updated one) a new row will populate in this table.

Using the Model Loader

  1. Export your data model: navigate to the table you want to export and click Design Table > Export. Choose whether to export as an XML or a JSON file.
  2. In the environment that you want to import into, navigate to the Model Loader by using the /apps/modelloader endpoint. For example: Cinchy.com/apps/modelloader
  3. Configure your settings. By default, the following are enabled:
    1. Drop Columns: tell Cinchy to drop columns in the import environment table if they have been removed from the model.
    2. Update Column Information: tell Cinchy to update column information (name, description, etc.) in the import environment table if they have been changed in the model.
    3. Rename Tables and Create/Update Domain Assignments: tell Cinchy to rename tables or domains in the import environment table if they have been changed in the model.
    4. Recalculate all existing values in changed calculated column formulas: tell Cinchy to update any existing calculated column data values in the import environment table if the formula changed within the model.
  4. Select Choose File and upload the XML/JSON file that you exported in step 1. Click Submit; the page should refresh with a "success" message.
  5. You can validate a successful model load by navigating to the imported table, or by finding it in the [Cinchy].[Models] system table.

Updating an Imported Model

After the initial model load, when you make changes to a data model (such as adding or renaming a column) and want to import an updated version into your environment you must change the version number prior to importing.

  1. Export your updated data model as per usual.
  2. Open the exported XML/JSON file.
  3. Under the data model info, update the version code. For instance, from version="1.0.0" to version="1.1.0"
  4. Save your updated XML/JSON file. You can then import it as per usual. Since this is a new model version, it will create a new row in the [Cinchy].[Models] table.