primaryKey¶
If true, this field will be the primary key for identifying records in the table. ManyToMany tables will use this primary key as it’s point of reference.
All tables must have at least ONE primary key.
See relational fields at: Relations Reference
The following options are available to all field types and are optional.
If true, this field will be the primary key for identifying records in the table. ManyToMany tables will use this primary key as it’s point of reference.
All tables must have at least ONE primary key.
If true, this field MUST be defined as something other than null or undefined when saved.
Fields are specified by type in the schema. The type is case insensitive, and in some cases allow for abbreviated versions of the field’s formal name.
Matching Types: str, string, text
A string field, for small to large sized strings. This is the only field type you can use for representing a primary key, which ideally would be similar to a UUID in structure to prevent collisions.
Matching Types: bool, boolean
A boolean field, representing a true, false or undefined value.
Matching Types: json
A field that can represent any Javascript object literal. When stored in the database it will be serialised using JSON.stringify() and retrieved using JSON.parse().
JSON field types are not indexed, so their ideal use is as a non searchable element of your database.
Matching Types: datetime
A field representing a DateTime. Can be saved as any value that can be parsed by the momentjs.com library, however it will ALWAYS be returned as a moment for continuity. Timezone information is maintained when saving.
Matching Types: date
A field representing a Date with no timezone information. As with DateTime, it is wrapped with momentjs.com when returned.
Matching Types: time
A field representing a Time with timezone information. As with DateTime, it is wrapped with momentjs.com when returned.