Built motion from commit d415888.|0.0.73
[motion.git] / server / models / company.js
1 /**
2  * tag Model
3  */
4
5 module.exports = function(sequelize, DataTypes) {
6
7   var Company = sequelize.define('Company', {
8     name: {
9       type: DataTypes.STRING,
10       unique: true
11     },
12     street: DataTypes.STRING,
13     postalCode: DataTypes.STRING,
14     city: DataTypes.STRING,
15     country: DataTypes.STRING,
16     sStreet: DataTypes.STRING,
17     sPostalCode: DataTypes.STRING,
18     sCity: DataTypes.STRING,
19     sCountry: DataTypes.STRING,
20   }, {
21     tableName: 'companies',
22     associate: function(models) {
23       Company.hasMany(models.Contact, {
24         as: 'Contacts'
25       });
26     }
27   });
28
29   return Company;
30 };