text: /**
   * Created by Bruno Costa 02-02-2018
   * Generated by Utilities/createTable.py
   */
  'use strict';
  
  module.exports = function(sequelize, DataTypes) {
    const Aluguer = sequelize.define('Aluguer', {
      id: { 
        type: DataTypes.INTEGER(11),
        autoIncrement: true,
        primaryKey: true,
        allowNull: false,
        unique: true,
      },
      barracaChapeusId: DataTypes.INTEGER(5),
      nome: DataTypes.STRING(254),
      data: DataTypes.DATE,
      valor: DataTypes.FLOAT,
      comentarioId: DataTypes.INTEGER(10),
      senha: DataTypes.INTEGER(10),
      lote: DataTypes.INTEGER(11),
      operadorId: DataTypes.INTEGER(11),
      registo: DataTypes.DATE,
    }, {
      tableName: 'Aluguer',
      timestamps: false,
      underscored: false,
  
     classMethods: {
        associate: function associate(models) {    
          Aluguer.belongsTo(models.BarracasChapeus, {
            foreignKey: 'barracaChapeusId',              //on Aluguer
            targetKey: 'id',  //foreign key  
          });
          Aluguer.belongsTo(models.Comentarios, {
            foreignKey: 'comentarioId',              //on Aluguer
            targetKey: 'id',  //foreign key  
          });
          Aluguer.belongsTo(models.Pessoas, {
            foreignKey: 'operadorId',              //on Aluguer
            targetKey: 'id',  //foreign key  
          }); 
        }
      },
    });
  
    return Aluguer;
  };
  