ReadonlyassociationsReadonlyattributesThe list of attributes that have been normalized.
This map is fully frozen and cannot be modified directly. Modify rawAttributes then call refreshAttributes instead.
ReadonlyattributesReadonlyattributesReadonlybooleanReadonlycolumnsReadonlydateReadonlydefaultReadonlyjsonReadonlymodelReadonlyoptionsReadonlyphysicalThe list of attributes that actually exist in the database, as opposed to virtualAttributeNames.
ReadonlyprimaryReadonlyrawThe list of attributes that have not been normalized. This list can be mutated. Call refreshAttributes to update the normalized attributes ().
ReadonlyreadList of attributes that cannot be modified by the user (read-only)
ReadonlytimestampRecords which attributes are the different built-in timestamp attributes
ReadonlyvirtualThe list of attributes that do not really exist in the database.
Follows 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.
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.