title: Sequelize.define() is not a function?
body: <p>Trying to play around with Sequelize in a node.js webserver.</p>
  
  <p>I have initialised the Sequelize connection pool in index.js like so</p>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>const config = require('./config/config');
  const app = require('./config/express');
  const Sequelize = require('sequelize');
  
  const sequelize = new Sequelize(config.mysql.database, config.mysql.user, config.mysql.pass, {
    host: config.mysql.host,
    dialect: 'mysql',
    operatorsAliases: false,
  
    pool: {
      max: 5,
      min: 0,
      acquire: 30000,
      idle: 10000
    },
  });
  
  sequelize
    .authenticate()
    .then(() =&gt; {
      console.log('Connection has been established successfully.'); // eslint-disable-line no-console
    })
    .catch((err) =&gt; {
      console.error('Unable to connect to the database:', err); // eslint-disable-line no-console
    });
  
  module.exports = { app, sequelize };
  </code></pre>
  
  <p><strong>user.js model</strong></p>
  
  <pre><code>const sequelize = require('sequelize');
  const DataTypes = require('mysql');
  /**
   * User model
   */
  const User = sequelize.define('user', {
  
    id: {
      type: DataTypes.INTEGER,
    },
    name: {
      type: DataTypes.STRING,
    },
    email: {
      type: DataTypes.STRING,
    },
    lastEmail: {
      type: DataTypes.TIME,
    }
  });
  </code></pre>
  
  <p>When trying to start the server I get the following error</p>
  
  <blockquote>
    <p>TypeError: sequelize.define is not a function ... user.js </p>
  </blockquote>
  
  <p>I am guessing the sequelize object is not being made global, however I tested the connection before creating the model and it was fine. </p>