text: const { Model, DataTypes } = require('sequelize');
  const bcrypt = require('bcrypt');
  const sequelize = require('../config/connection');
  
  class Role extends Model {
    checkPassword(loginPw) {
      return bcrypt.compareSync(loginPw, this.password);
    }
  }
  
  Role.init(
    {
      id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      name: {
        type: DataTypes.STRING,
        allowNull: false
      }
    },
    {
      sequelize,
      timestamps: true,
      freezeTableName: true,
      underscored: true,
      modelName: 'role'
    }
  );
  
  module.exports = Role;
  