Skip to Content
DocsVisual ModelingColumns and Constraints

Columns and Constraints

Columns define the information stored in a table. Each column has a name, data type, and optional constraints that control how data is stored and validated.

In Qubase, columns are managed directly from the ERD Canvas, allowing you to design your database visually while maintaining a consistent schema.

Before you begin

Before adding columns, ensure that you have:

  • Created a Database Schema
  • Created at least one table
  • Opened the ERD Canvas

[!NOTE] Every table should contain at least one column. Most tables also include a Primary Key.


Add a column

To add a new column:

  1. Select a table on the ERD Canvas.
  2. Click Add Column.
  3. Enter the column information.
  4. Save the changes.

The new column is immediately displayed inside the selected table.


Column properties

Each column includes several properties.

PropertyDescription
NameUnique column name within the table
Data TypeDefines the type of data stored
NullableDetermines whether the column can contain NULL values
Default ValueOptional value used when no value is provided
DescriptionOptional documentation for the column

Common data types

The available data types depend on the selected database system.

Data TypeDescriptionExample
INTEGERWhole numbers100
BIGINTLarge integers999999999
VARCHARVariable-length textJohn Doe
TEXTLong textProduct description
BOOLEANTrue or Falsetrue
DATECalendar date2026-08-05
TIMESTAMPDate and time2026-08-05 10:30
DECIMALDecimal numbers199.99
UUIDUniversally unique identifier550e8400…

[!TIP] Choose the smallest suitable data type to improve storage efficiency.


Column constraints

Constraints help enforce data integrity.

ConstraintPurpose
Primary KeyUniquely identifies each record
Foreign KeyReferences another table
UniquePrevents duplicate values
Not NullRequires a value
DefaultAutomatically assigns a default value
CheckValidates data against a condition

Example table

Customers PK customer_id UUID full_name VARCHAR(100) email VARCHAR(255) UNIQUE phone VARCHAR(30) created_at TIMESTAMP

Editing columns

To modify an existing column:

  1. Select the table.
  2. Click the column.
  3. Update the required properties.
  4. Save the changes.

Updates are immediately reflected on the ERD Canvas.


Reordering columns

Columns can be reordered to improve readability.

Simply drag a column to its new position within the table.

Changing the display order does not affect database functionality unless the exported SQL depends on column order.


Deleting columns

To remove a column:

  1. Select the column.
  2. Click Delete.
  3. Confirm the action.

[!WARNING] Deleting a column may affect relationships, queries, or application logic that depend on it.


Validation

Qubase validates your schema while editing.

Validation checks may include:

  • Duplicate column names
  • Missing data types
  • Invalid default values
  • Missing Primary Keys
  • Constraint conflicts

Any detected issues are displayed before exporting or generating SQL.


Best practices

  • Use meaningful column names.
  • Keep naming conventions consistent.
  • Assign appropriate data types.
  • Avoid unnecessary NULL values.
  • Use constraints to protect data integrity.
  • Document important columns with descriptions.

Last updated on