{% for relation in table.m2oRelations.array -%} {% set cr = c.belongsTo[belongsToAlias(relation)] -%} {# Custom data of relation #} {{ modelName(table) }}.belongsTo({{ modelName(relation.targetTable) }}, { {% if options.generateAliases -%} as : {{ cr.as or (belongsToAlias(relation).val | singleQuote) }},{% if cr.as -%} // as: "{{ belongsToAlias(relation) }}"{% endif %} {% endif -%} foreignKey: {{ cr.foreignKey or (relation.constraint.columns.array[0].name | singleQuote) }}, {# Sequelize supports only single column FK :( #} onDelete : {{ cr.onDelete or (relation.constraint.onDelete | singleQuote) }}, onUpdate : {{ cr.onUpdate or (relation.constraint.onUpdate | singleQuote) }} }); {% endfor %}