text: const { Model, DataTypes } = require('sequelize');
  
  const sequelize = require('../config/connection');
  
  class ProductTag extends Model {}
  
  ProductTag.init(
    {
      //this model will allow us to reach tags through the product Id
      id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
      },
      //This is going to reference the pk of product
      product_id: {
        type: DataTypes.INTEGER,
        references: {
          model: 'product',
          key: 'id',
        },
      },
      //this is going to reference the pk of tag
        tag_id: {
          type: DataTypes.INTEGER,
          references: {
            model: 'tag',
            key: 'id',
          },
      }
    },
    {
      sequelize,
      timestamps: false,
      freezeTableName: true,
      underscored: true,
      modelName: 'product_tag',
    }
  );
  
  module.exports = ProductTag;
  