const Sequelize = require('sequelize');

module.exports = (sequelize) => {
    class Action extends Sequelize.Model {
        static associate(db) {
           Action.belongsTo(db.Tache, {onDelete: 'cascade'});
           Action.belongsTo(db.Participant, {onDelete: 'cascade'});
        };
    }

    Action.init({
        date: Sequelize.DATEONLY
    }, {sequelize, modelName: 'Action'});

    return Action;
};