I am working with node, express and sequelize (I'm pretty new with all these three) and I'm getting "Unknown column 'productTeam' in 'field list'"
in what I think is the simplest possible scenario:
In my backend code, I have the following:
const repos = await ScasRepo.findAll(
{
where: {"productId": productId}
}
)
I can see that the generated query is as follows:
Executing (default):
SELECT `id`, `productTeam`, `productId`
FROM `ScasRepos` AS `ScasRepo`
WHERE `ScasRepo`.`productId` = '10519';
And this is what my table looks like:
mysql> describe ScasRepos;
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| productId | int | YES | | NULL | |
| productTeam | varchar(255) | YES | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
As you can see, the productTeam
field is defined in the table, so why am I getting an error message saying "Unknown column 'productTeam' in 'field list'"
?
Any insight is appreciated!