static associate(models) {
      // define association here
      like.belongsTo(models.user, {
        as: "user",
        foreignKey: {
          name: "userId",
        },
      });

      like.belongsTo(models.post, {
        as: "post",
        foreignKey: {
          name: "postId",
        },
      });
    }
/**
     * Helper method for defining associations.
     * This method is not a part of Sequelize lifecycle.
     * The `models/index` file will call this method automatically.
     */
Helper method for defining associations.
This method is not a part of Sequelize lifecycle.
The `models/index` file will call this method automatically.
Helper method for defining associations . This method is not a part of Sequelize lifecycle . The ` models / index ` file will call this method automatically .
static associate(models) {
      like.belongsTo(models.user, {
        as: "user",
        foreignKey: {
          name: "userId",
        },
      });
      like.belongsTo(models.post, {
        as: "post",
        foreignKey: {
          name: "postId",
        },
      });
    }
static associate ( models ) { like . belongsTo ( models . user , { as : "user" , foreignKey : { name : "userId" , } , } ) ; like . belongsTo ( models . post , { as : "post" , foreignKey : { name : "postId" , } , } ) ; }
Helper method for defining associations.
Helper method for defining associations .
// define association here