title: How export and use models in sequelize
body: <p>i use sequelize in my node.js project, and i dont know how to export and use table model in another file. 
  I save table models in folder for example Profile.js</p>
  
  <pre><code>module.exports = (sequielize, DataTypes) =&gt; sequielize.define('Profile', {
    ID: {
      type: DataTypes.INTEGER,
      autoIncrement: true,
      primaryKey: true,
      allowNull: false
    },
    Login: {
      type: DataTypes.STRING(24),
      allowNull: false
    },
    SocialClub: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    Email: {
      type: DataTypes.STRING(64),
      allowNull: false
    },
    RegIP: {
      type: DataTypes.STRING(17),
      allowNull: false
    },
    LastIP:
    {
      type: DataTypes.STRING(17),
      allowNull: false
    },
    RegDate: {
      type: DataTypes.DATE,
      defaultValue: DataTypes.NOW,
      allowNull: false
    },
    LastDate: {
      type: DataTypes.DATE,
      defaultValue: DataTypes.NOW,
      allowNull: false
    }
  });
  </code></pre>
  
  <p>And I have such database module database.js:</p>
  
  <pre><code>const Sequelize = require('sequelize');
  const fs = require('fs')
  const path = require('path')
  const config = require('../configs/server_conf');
  
  db = {};
  
  const sequelize = new Sequelize(
      config.db_settings.database,
      config.db_settings.user,
      config.db_settings.password,
      config.db_settings.options);
  
  db.sequelize = sequelize;
  db.Sequelize = Sequelize;
  
  db.checkConnection = async function() {
      sequelize.authenticate().then(() =&gt; {
  
          console.log('Подключение к базе данных прошло успешно!');
  
          //import db models
          fs.readdirSync(path.join(__dirname, '..', 'models')).forEach(file =&gt; {
              var model = sequelize.import(path.join(__dirname, '..', 'models', file));
              db[model.name] = model;
  
          });
  
          sequelize.sync({
              force: true
          }).then(() =&gt; {
              console.log('synchroniseModels: Все таблицы были созданы!');
          }).catch(err =&gt; console.log(err));
  
          mp.events.call("initServerFiles");
  
      }).catch(err =&gt; {
          console.error('Невозможно подключиться к базе данных:', err);
      });
  }
  
  module.exports = db;
  </code></pre>
  
  <p>And i have such an index.js file where i'm exporting checkConnection function:</p>
  
  <pre><code>"use strict"
  
  const fs = require('fs');
  const path = require('path');
  
  const { checkConnection } = require('./modules/database.js');
  var Events = [];
  
  mp.events.add(
  {
      "initServerFiles" : () =&gt;
      {
          fs.readdirSync(path.resolve(__dirname, 'events')).forEach(function(i) {
              Events = Events.concat(require('./events/' + i));
          });
  
          Events.forEach(function(i) {
              mp.events.add(i);
              console.log(i);
          });
  
          mp.events.call('initServer');
  
          console.log("Загрузка всех файлов прошла успешно!");
      }
  });
  
  checkConnection();
  </code></pre>
  
  <p>So in a nutshell, how i can export my Profile table and use it, for example:</p>
  
  <pre><code>Profile.create({
              Login: "0xWraith",
              SocialClub: "0xWraith",
              Email: "mail@gmail.com",
              RegIP: "127.0.0.1",
              LastIP: "127.0.0.1",
              LastDate: "07.04.2020"
          }).then(res =&gt; {
               console.log(res);
          }).catch(err=&gt;console.log(err));
  </code></pre>