const Sequelize = require('sequelize');
const Model = Sequelize.Model;

module.exports = (sequelize) => {
    class Group extends Model {
        static associate(db) {
            Group.belongsToMany(db.Person, {through:'PersonGroup'});
        };
    }

    Group.init({
        title: Sequelize.STRING
    }, {sequelize, modelName: 'Group'});
    
    return Group;
};