Property
- Belongs to an Entity.
- Multiple types supported: NUMBER, TEXT, DATE, ENTITY, MEDIA, and SELECT.
Life Cycle
Route | Create | Read | Update | Delete |
---|---|---|---|---|
/admin/entities/:entity-slug/properties |
Properties
Name | Title | Type | Description |
---|---|---|---|
entityId * | Entity | Entity | Parent Entity. |
order * | Order | Int | Order of display at generated views and forms. |
name * | Name | String | Internal identifier. |
title * | Title | String | Can be a i18n key, e.g. First name or models.employee.firstName. |
type * | Type | PropertyType | NUMBER, TEXT, DATE, ENTITY, MEDIA, or SELECT |
isDynamic | Is Dynamic | Boolean | Is a custom property. Uncheck if you have your own database model (not all property types are supported for this). |
isDefault | Is Default | Boolean | There are 3 main default properties on every row: Folio, createdAt, and createdByUser. |
isHidden | Is Hidden | Boolean | Hides at autogenerated forms. |
pattern | Pattern | String | Native input pattern validation. |
options | Options | PropertyOption[] | For [type]=SELECT properties. |
values | Row Values | RowValue[] | Row property value. |
Model
model Property {
id String @id @default(cuid())
entityId String
entity Entity @relation(fields: [entityId], references: [id], onDelete: Cascade)
order Int
name String
title String
type Int
parentId String?
parent Property? @relation(name: "parentProperty", fields: [parentId], references: [id], onDelete: Cascade)
isDynamic Boolean
isDefault Boolean
isRequired Boolean
isHidden Boolean
pattern String?
options PropertyOption[]
values RowValue[]
@@unique([entityId, order])
@@unique([entityId, name])
@@unique([entityId, title])
}