Private
Readonly
#attributesPrivate
Readonly
#attributesPrivate
Readonly
#attributesPrivate
#autoPrivate
Readonly
#booleanCode should not rely on this as users can create custom attributes.
Private
Readonly
#columnsPrivate
Readonly
#dateCode should not rely on this as users can create custom attributes.
Private
Readonly
#defaultPrivate
#indexesFinal list of indexes, built by refreshIndexes
Private
Readonly
#jsonPrivate
Readonly
#physicalPrivate
Readonly
#primaryPrivate
Readonly
#readList of attributes that cannot be modified by the user
Private
Readonly
#sequelizePrivate
Readonly
#tablePrivate
Readonly
#versionThe name of the attribute that records the version of the model instance.
Private
Readonly
#virtualReadonly
associationsReadonly
attributesThe list of attributes that have been normalized.
This map is fully frozen and cannot be modified directly. Modify rawAttributes then call refreshAttributes instead.
Readonly
attributesReadonly
attributesReadonly
booleanCode should not rely on this as users can create custom attributes.
Readonly
columnsReadonly
dateCode should not rely on this as users can create custom attributes.
Readonly
defaultReadonly
jsonReadonly
modelReadonly
optionsReadonly
physicalThe list of attributes that actually exist in the database, as opposed to virtualAttributeNames.
Readonly
primaryReadonly
rawThe list of attributes that have not been normalized. This list can be mutated. Call refreshAttributes to update the normalized attributes ().
Readonly
readList of attributes that cannot be modified by the user (read-only)
Readonly
timestampRecords which attributes are the different built-in timestamp attributes
Readonly
virtualThe list of attributes that do not really exist in the database.
Private
#addPrivate
#addPrivate
#getPrivate
#namePrivate
#refreshFollows the association path and returns the association at the end of the path. For instance, say we have a model User, associated to a model Profile, associated to a model Address.
If we call User.modelDefinition.getAssociation(['profile', 'address'])
, we will get the association named address
in the model Profile.
If we call User.modelDefinition.getAssociation(['profile'])
, we will get the association named profile
in the model User.
Returns the column name corresponding to the given attribute name if it exists, otherwise returns the attribute name.
⚠️ Using this method is highly discouraged. Users should specify column names & attribute names separately, to prevent any ambiguity.
Normalizes all attribute definitions, using rawAttributes as the source.
The goal of this class is to store the definition of a model.
It is part of the Repository Design Pattern. See https://github.com/sequelize/sequelize/issues/15389 for more details.
There is only one ModelDefinition instance per model per sequelize instance.