title: TypeError: models[model].defineConstraints is not a function
body: <p>I`m trying to undestand whats going on and why defineConstraints is not a function. can someone help me ?</p>
  <p>Heres examples of my code.</p>
  <p>index.js</p>
  <pre><code>const Sequelize = require('sequelize');
    config = require('config');
  
  const dbConf = config.get('database');
  console.log(dbConf);
  
  
  const sequelize = new Sequelize(dbConf.database, dbConf.user, dbConf.password,{
    dialect: 'postgres',
    host: dbConf.host,
    port: dbConf.port,
    logging: console.log
  });
  
  sequelize.Model = Sequelize.Model;
  
  const models = {
    User: sequelize.import(__dirname + '/models/user.js'),
    Service: sequelize.import (__dirname + '/models/service.js'),
    Subscriber: sequelize.import (__dirname + '/models/subscriber.js'),  
  };
  
  for(const model in models) {
    models[model].defineConstraints(models);
  }
  
  models.Op = Sequelize.Op;
  models.sequelize = sequelize;
  
  module.exports = models;
  </code></pre>