Model Reference
Required fields for the extension and further explanation what each field is trying to achieve.
Last updated
Required fields for the extension and further explanation what each field is trying to achieve.
Last updated
If your Prisma version below 5.0.0
consider upgrade to this version.
path
type: String
flags: @unique
A unique string that stores the materialized path of each node. The string is constructed of base 36 encoded, padded to minimum 4 characters. Which grants 1679615 children per node.
It is recommended to define an index in the schema for path
since almost all methods rely on ordering by path in some ways.
Database type can optionally be mapped to a more performant where it's allowed, such as in the case of PostgreSQL or MySQL.
depth
type: Int
Integer that stores the depth of the node in the tree. Its main function is to speeds up the database queries by filtering down possible nodes to a given depth. However this comes at the cost of higher complexity when nodes are created or moved around.
numchild
type: Int
flags: @default(0)
Adapted from
An integer that stores the number of children of a given node. Just like , its main function to speed up queries by storing this value ahead of time so we don't have to run redundant queries if we know it will yield no result. For example will return nothing without running any database queries when the numchild
is 0.
Adapted from