Learn how to create and configure entity fields, their data types, and advanced customization options in Amplication.
name
, email
, or price
. This page will guide you through creating and configuring entity fields within Amplication.
Navigate to the Entity Screen
Select an Entity
Add a New Field
Configure Field Details
customerEmail
)Unique Field
Toggle Unique Field to ensure that each value in this field is unique across all instances of the entity. This is crucial for fields like email addresses or usernames where duplication isn’t allowed.
Required Field
Activate Required Field to make sure that this field must have a value when creating a new entity instance. This prevents incomplete data entries and enforces data integrity for critical attributes.
Searchable
Enable Searchable to allow users to search for entity instances based on the values in this field. Note that field visibility for search results is still controlled by permissions settings.
id
: A unique identifier for each entity instance. By default, it’s a CUID, but you can customize it to UUID, auto-increment integer, or auto-increment big integer.createdAt
: Automatically tracks the creation timestamp of each entity instance.updatedAt
: Automatically updates with the timestamp whenever an entity instance is modified.@
) to customize individual field properties. These are accessible in the Custom Attributes text field within each field’s settings page.
Common field-level attributes include:
@unique
: Enforce uniqueness for a field@default(...)
: Set a default value@map("column_name")
: Map to a different column name@db.VarChar(200)
)