text: import Sequelize from 'sequelize';
  import mongoose from 'mongoose';
  import dataBaseConfig from '../config/database';
  import User from '../app/models/User';
  import File from '../app/models/File';
  import Appointments from '../app/models/Appointments';
  
  const models = [User, File, Appointments];
  
  class Database {
    constructor() {
      this.init();
      this.mongo();
    }
  
    init() {
      this.connection = new Sequelize(dataBaseConfig);
  
      models
        .map(model => model.init(this.connection))
        .map(model => model.associate && model.associate(this.connection.models));
    }
  
    mongo() {
      this.connect = mongoose.connect('mongodb://localhost:27017/gobarber', {
        useNewUrlParser: true,
        useFindAndModify: true,
      });
    }
  }
  
  export default new Database();
  