module.exports = (sequelize, DataTypes) => {
  const Group = sequelize.define('Group', {
    name: {
      type: DataTypes.STRING,
      unique: true,
      allowNull: false,
    },
    description: {
      type: DataTypes.STRING,
      allowNull: false,
    }
  });
  Group.associate = (models) => {
    Group.hasMany(models.Message, {
      foreignKey: 'GroupId',
      as: 'groupMesages',
    });
    Group.belongsToMany(models.User, {
      // as: 'Groups',
      foreignKey: 'groupId',
      through: 'UserGroups',
    });
  };
  return Group;
};

@@ -349,17 +349,17 @@
 gnKey: '
-G
+g
 roupId',
@@ -364,16 +364,19 @@
 ',%0A     
+ //
  as: 'gr

Edit commit messages