{"size": 544, "ext": "js", "max_stars_repo_path": "server/models/favorite.js", "max_stars_repo_name": "seanbecker15/wherecanifindit", "max_stars_repo_stars_event_min_datetime": "2018-04-17T21:02:32.000Z", "max_stars_repo_stars_event_max_datetime": "2018-11-26T01:03:45.000Z", "max_issues_repo_path": "server/models/favorite.js", "max_issues_repo_name": "seanbecker15/wherecanifindit", "max_issues_repo_issues_event_min_datetime": "2018-04-17T21:15:26.000Z", "max_issues_repo_issues_event_max_datetime": "2018-04-26T00:37:19.000Z", "max_forks_repo_path": "server/models/favorite.js", "max_forks_repo_name": "seanbecker15/wherecanifindit", "max_forks_repo_forks_event_min_datetime": "2018-04-14T12:58:01.000Z", "max_forks_repo_forks_event_max_datetime": "2018-04-17T09:59:59.000Z"}
{"max_stars_count": 2, "max_issues_count": 4, "max_forks_count": 2, "avg_line_length": 23.652173913, "max_line_length": 51, "alphanum_fraction": 0.5367647059}
module.exports = (sequelize, DataTypes) => {
    const Favorite = sequelize.define('Favorite', {
        user_id: DataTypes.INTEGER,
        show_id: DataTypes.INTEGER,
    });

    Favorite.associate = (models) => {
        models.Favorite.belongsTo(models.User, {
          as: 'user',
          onDelete: 'CASCADE',
          foreignKey: 'user_id',
        });

        models.Favorite.belongsTo(models.Show, {
          as: 'show',
          onDelete: 'CASCADE',
          foreignKey: 'show_id',
        });
    };

    return Favorite;
};
