How to Create Custom Data Types in DbSchema



Custom data types in DbSchema’s Logical Design help architects enforce consistent column definitions across large models (e.g., all usernames use the same length everywhere). Important: these types are design-time abstractions. When you deploy to a real database (e.g., MySQL), DbSchema generates the native DBMS type (such as VARCHAR(150)), not the custom name (UserName).


Open Data Type Settings

  1. Open your project in DbSchema.
  2. Go to Model → Settings → DBMS Specific → Data Types.
  3. In the DBMS selector, choose Logical Design.
DbSchema Data Types settings with DBMS selector
Select Scope
Choose Logical Design to define model-level types.
Add New
Create a reusable custom data type.

Define a Custom Data Type

  1. Click + Add New.
  2. Give the type a clear, descriptive name and set its length:

Examples:

  • MoneyAmountDOUBLE, then mapped in Conversion Dictionary to DECIMAL(19,4).
  • CustomerCodeCHAR(10)
  • CreatedAtTIMESTAMP
  1. Click OK to save.
Create a Logical Design custom data type with a set length

Map the Type for Deployment

Your Logical Design type needs a mapping so that, on deployment, DbSchema generates the correct native DBMS type and precision.

  1. Open Model → Conversion Dictionary.
  2. Click +Data Type, and choose the data type created earlier. (MoneyAmount)
  3. Choose the target DBMS (e.g., MySQL).
  4. Map it to the native type and set the exact precision (e.g., DECIMAL(19,4)).
  5. Save.
Map Logical Design types to native DBMS types using Conversion Dictionary

Use the Custom Type in Your Model

  • In the column editor, select your custom type (e.g., MoneyAmount).
  • When you generate SQL or deploy, DbSchema applies the mapping and emits the native DBMS type.
Deploying mapped Logical Design types produces native DBMS types

Example:

The Logical Design types are now mapped so deployment emits native DBMS types.

Deploying mapped Logical Design types produces native DBMS types

What Happens at Deployment?

  • In the model: you work with logical names like MoneyAmount, CustomerCode, CreatedAt.
  • On deployment: DbSchema automatically converts each logical type to the mapped native DBMS type (e.g., MoneyAmount → DECIMAL(19,4), CustomerCode → CHAR(10), CreatedAt → TIMESTAMP in MySQL).
  • No extra steps: the SQL generator uses your Conversion Dictionary; you can preview the exact DDL in Schema Compare / Generate SQL before applying.
  • In the database: developers will see only the native types (e.g., DECIMAL(19,4), CHAR(10), TIMESTAMP) produced by these mappings.
DbSchema Data Types settings with DBMS selector
Logical Design
Physical Design

Troubleshooting

  • “Length required” prompts in MySQL UI: expected only if you use a DBMS-specific type. For Logical Design types, set the length in the type definition and the exact DBMS length in the Conversion Dictionary.
  • Custom name not visible in DB: by design. Logical Design names are model-level abstractions. The DB stores native types.

Summary

  • Create custom types in Logical Design to standardize columns.
  • Use the Conversion Dictionary to map each type to the exact native DBMS type (MoneyAmount → to DECIMAL(19,4) in MySQL).
  • On deployment, DbSchema converts Logical Design names to native types, ensuring consistency without leaking modeling abstractions into the database.


Next Step

Want to try this out yourself? Download DbSchema Free Trial and start designing with custom data types today.

You may also find these guides helpful:

DbSchema Database Design Tool

The Art of Keeping the Data Together
DbSchema is a desktop app for
DbSchema ER Diagram Read More About DbSchema
Visual Design & Schema Diagram

➤ Create and manage your database schema visually through a user-friendly graphical interface.

➤ Easily arrange tables, columns, and foreign keys to simplify complex database structures, ensuring clarity and accessibility.

GIT & Collaboration
Version Control & Collaboration

➤ Manage schema changes through version control with built-in Git integration, ensuring every update is tracked and backed up.

➤ Collaborate efficiently with your team to maintain data integrity and streamline your workflow for accurate, consistent results.

Data Explorer & Query Builder
Relational Data & Query Builder

➤ Seamlessly navigate and visually explore your database, inspecting tables and their relationships.

➤ Build complex SQL queries using an intuitive drag-and-drop interface, providing instant results for quick, actionable insights.

Interactive Documentation & Reporting
HTML5 Documentation & Reporting

➤ Generate HTML5 documentation that provides an interactive view of your database schema.

➤ Include comments for columns, use tags for better organization, and create visually reports.