Sequelize.js insert a model with one-to-many relationship
问题 I have two sequelize models with one-to-many relationship. Let's call them Owner and Property. Assume they are defined using the sails-hook-sequelize as such (simplified). //Owner.js module.exports = { options: { tableName: 'owner' }, attributes: { id: { type: Sequelize.BIGINT, allowNull: false, primaryKey: true, autoIncrement: true }, name: { type: Sequelize.STRING(255) }, associations: function () { Owner.hasMany(Property, { foreignKey: { name: 'owner_id' } }); } } //Property.js module