EPUB | CHM | PDF

How to Create a Domain

Top Previous Next

The Domain Manager is intended for managing diagram domains, which can be used for faster creating and modifying table columns.

To open the Domain Manager use the Domain Manager item on Diagram tab of Ribbon or press Ctrl + 1.

editor-domain

The Domain Manager consists of the following areas:

Domain List
Properties Pane
Button Pane.

Domain List

The domain list displays all the domains in the diagram and allows you to modify the following domain properties:

Domain name
The name of the domain, which must be unique within the diagram.

Data type
The type of the domain, which specifies data to store in the domain-based column; it can be one of integer types, which differ in data size (TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT), decimal type (FLOAT, DOUBLE, DECIMAL), a type for storing date and time values (DATE, DATETIME, TIMESTAMP, TIME, YEAR), string type (CHAR, VARCHAR), a large binary type (TINYBLOB, BLOB, MEDUIMBLOB, LONGBLOB), a multi-line text (TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT), enumeration type, which can contain only values from the Set attribute (ENUM), or a set of values from the Set attribute (SET).

Primary key
Specify this option to include the domain-based columns into the table primary key.

Comment
An arbitrary description for the domain.

Properties Pane

The properties pane allows you to define the advanced properties of the domain, selected in the Domain List. The appearance of this pane changes according to the data type of the domain. These properties are:

Not null
This option indicates that a domain-based column value cannot be NULL;

Default
This attribute defines the default value, which the domain-column accepts if no other is specified;

Decimals
This attribute defines the number of digits, which follow the decimal point in the FLOAT, DOUBLE, and DECIMAL types.

Length
This attribute defines the maximum allowed length of the stored values; it applies to all integer, decimal, and string types.

Binary
This attribute indicates that the string value is stored in a binary form within the domain.

Unsigned
This option indicates that the stored integer or decimal value must be above zero.

Zerofill
With this attribute all unspecified digits of the domain-column value are filled as zeros according to the column size and precision; it applies to all integer and decimal types.

Unique
This option indicates that the domain-column value must be unique within the table, creating a unique index for the domain.

Autoinc
This attribute makes the domain-column value autoincrement, i.e. each new value is set automatically according to the previous value; it applies to all integer values.

Set
This attribute defines the list of permissible values for the domain of the ENUM or SET type.

Buttons Pane

The buttons under the list of domains allows you to perform the following actions:

Add
Add a new domain with the default properties to the end of the list;

Duplicate
Add a new domain with the same properties as the selected domain to the end of the list;

Delete
Remove the selected domain from the list.

See also:
Diagram Objects: Domains | Columns
Tutorials: Using Domains