5 module.exports = function(sequelize, DataTypes) {
7 var Contact = sequelize.define('Contact', {
9 type: DataTypes.STRING,
14 tags: DataTypes.STRING,
15 // CompanyId: DataTypes.STRING,/Da creare con l' associazione
16 street: DataTypes.STRING,
17 postalCode: DataTypes.STRING,
18 city: DataTypes.STRING,
19 country: DataTypes.STRING,
20 dateOfBirth: DataTypes.STRING,
21 description: DataTypes.STRING
23 tableName: 'contacts',
24 associate: function(models) {
25 Contact.belongsToMany(models.ContactPhone, {
26 through: 'contact_has_phones',
29 Contact.belongsToMany(models.ContactEmail, {
30 through: 'contact_has_emails',
33 Contact.belongsToMany(models.CustomField, {
34 through: models.ContactHasCustomField,
37 Contact.belongsTo(models.Company);
38 Contact.belongsTo(models.User);