new GeneratorUtil(model)
Parameters:
Name | Type | Description |
---|---|---|
model |
- Source:
Methods
-
getAttribute(name) → {Object}
-
Searches and returns relation with the given attribute. Alias is defined in sequelize options with parameter 'as'
Parameters:
Name Type Description name
string Name of the attribute.
- Source:
Returns:
- Type
- Object
-
getRelation(as) → {Object}
-
Searches and returns relation with the given alias. Alias is defined in sequelize options with parameter 'as'
Parameters:
Name Type Description as
string Alias of the relation.
- Source:
Returns:
- Type
- Object
-
renameAttribute(oldName, newName)
-
Searches and returns relation with the given attribute. Alias is defined in sequelize options with parameter 'as'
Parameters:
Name Type Description oldName
string Name of the attribute which it's name to be changed.
newName
string New name of the attribute.
- Source:
Throws:
Will throw error if there is already an attribute with new name exists or attribute with oldName does not exists.