GLOBAL SITES
 Home > CodeAuto > Macrobject CodeAuto Manual
CodeAuto Introduction
Import Schema from Database
Edit Data Schema
Synchronize and Merge Schema
  Open Schema File
  Synchronize Schema
  Merge Schema
Choose a Template for Code Generating

4.2    Synchronize Schema

Click the "Synchronize" button on the toolbar, and then CodeAuto will retrieve the schema information from database. The window Synchronize from Database will be prompted as follows:

The above picture is the window of Synchronize from Database. The left column shows the current schema, and the right one shows the information of current schema of the database.

In the picture, both left and right columns have a tree structure. The first layer is table, under which are field and relation, including parent-relation and child-relation.

During synchronization, in order to present it clearly, we use = to indicate the corresponding items in the two columns are the same, and <> to indicate they are different.

The same items are represented in light color in the left and right columns (As in the above picture, all of them are equal, so all of them are represented in light color.)

All different items are highlighted as in the following picture. If the item in the left exists, whereas its corresponding one in the right doesn't, then the item in the right column will be noted as [none].  On the contrary, if the item in the right exits, whereas its corresponding one in the left doesn't, then the left item will be noted as [new]:

 

The function of each button in the window is as follows:

Select All

No matter same or not, all items in the two columns will be selected.

Select None

No matter same or not, none will be selected in the two columns.

Select same items

Select same items in the two columns.

Select items in left column

Select the items listing in the left column.

Select items in right column

Select the items listing in the right column.

 

By default, CodeAuto will select all items listing in the left column when the window of merge or synchronization is opened.

l  "All Same" will remain all the tables, fields and relations that included both in the current schema and the schema in the right column.

l  "All Left" will remain all the information of the current schema, and synchronize with the latest information of the same items of the schema in the right column.

l  "All Right" will save the information of the schema in the right column. If the items in the left are existing, the information edited by user will be reserved (such as the alias of a table modified by user).

 

You can also select a single item, but you have to obey the following rules (CodeAuto processes it automatically):

l  Each table must remain its primary key. If the primary key is canceled, so is the table.

l  Relation has double direction. If the parent-relation (relate to table B) of table A is selected, then the child-relation (relate to table A) of table B is selected automatically. This applies to cancellation of a relation.

l  As a relation is selected, the corresponding field in the two relational tables will be selected automatically.

l  When canceling a field, if the relation depends on a foreign key, then the relation will be canceled automatically.

In the above picture, click "OK" button, then all the selected items will enter into the current schema. You can view the corresponding change after return to schema edit window.

Related Topics

Synchronize and Merge Schema