К🇦
Size: a a a
К🇦
YZ
К🇦
К🇦
К🇦
YZ
К🇦
YZ
К🇦
YZ
К🇦
PA
YZ
VP
countries.associate = function (models) {
models.countries.hasMany(models.bases,{as: 'countryId', foreignKey: 'id'});
};
базы: base.associate = function (models) {
models.bases.belongsTo(models.countries, {
onDelete: "CASCADE",
foreignKey: {
allowNull: true
}
});
};
и хочу получить через findAll({include: [{
model: models.countries,
as: 'countryId'
}]});
но получаю ошибкуcountries is associated to bases using an alias. You've included an alias (countryId), but it does not match the alias(es) defined in your association (country).что я делаю не так?
YZ
VP
YZ
YZ
YZ