Glossary Item Box

DBACentral for MySQL Submit feedback on this topic   

Edit Relationship Dialog

The Edit Relationship dialog allows you to edit the main properties of the relationship you create or modify and customize your work with this relationship in DBACentral for MySQL. To open Edit Relationship simply double-click the relationship in the Relationships designer. This dialog also appears on creating a new relationship, when you double-click on an empty area in the designer or drag a field from one table to another.

 

The Edit Relationship dialog is contains three tabs. The first one - the General tab determines the parent and child table and columns, sets the update and delete rules, and allows you to create a native MySQL foreign key, if it is allowed. The Join Type tab allows you to define the properties of the query joins, automatically created in the Query Designer, based on this relationship. The Lookup Properties tab allows you to customize the appearance of the related values in the Table Data Grid View.

 

 

Select the parent table from the Parent Table drop-down list and select the related table from the Related Table list. Then select the parent and related fields in the list below. You should define at least one pair of fields.

 

The Update Constraint and Delete Constraint determine the system behavior on changing data in the parent field. The following constraint actions are available:

  • No Action - this enables you to keep the data integrity manually; with this selection relationships are only useful in DBACentral for managing table data, building queries, forms, etc.
  • Restrict - this option strictly forbids updating/deleting data in parent table, if there are linked records in a child table.
  • Cascade - this option cascades all changes in parent table data, i.e. deletes the corresponding related values or updates them to the new values.
  • Set Null - this option sets all related values to NULL on updating or deleting data in parent table.
  • Set Default - this option sets all related values to the default value on updating or deleting data in parent table.

     

    The Native InnoDB Foreign Key option is available only if your MySQL server version is 4.1 or higher, and both of the selected tables are of InnoDB type. It creates or updates the appropriate database foreign key.

     

     

    This tab allows you to customize joins automatically created in the Query Designer when you add two linked tables to the query. The Join Operator group box defines the logical operator to use in the join and the check boxes define the join type: inner join (none checked), right join (Include all records from the parent table checked), or left join (Include all records from the related table checked).

     

     

    This tab allows you to customize your work with the related values in the Table Data Grid View. If a table column is a related part of some relationship, the Table Data Grid View allows you to select its values from the drop-down list of the parent column values.

     

    The Display Field list of the Relationship Editor dialog allows you to select the field, which value is actually displayed in the grid. E.g. on the pictures above you can see, that the linked fields (referees.referee_id and matches.referee) are integer fields, but setting the Display Field to name allows you to see the referees.name value in the grid, when you work with the matches table. This helps a lot in viewing and modifying the related column data.

     

    The Lookup List Fields allow you to add fields (in addition to the Display Field), visible in the list of available values, when you edit the related column in the the Table Data Grid View.

  •  

     


    ©2004 MicroOLAP Technologies LTD. All Rights Reserved. All trademarks are the sole property of their respective owners.