我收到以下错误:
{ [SequelizeDatabaseError: ER_BAD_FIELD_ERROR: Unknown column 'activityId' in 'field list']
name: 'SequelizeDatabaseError',
message: 'ER_BAD_FIELD_ERROR: Unknown column \'activityId\' in \'field list\'',
parent:
{ [Error: ER_BAD_FIELD_ERROR: Unknown column 'activityId' in 'field list']
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlState: '42S22',
index: 0,
sql: 'SELECT `id`, `activityType`, `customData`, `createdAt`, `updatedAt`, `activityId` FROM `activitiesTemplates` AS `ActivitiesTemplate` WHERE `ActivitiesTemplate`.`id` = NULL LIMIT 1;' },
original:
{ [Error: ER_BAD_FIELD_ERROR: Unknown column 'activityId' in 'field list']
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlState: '42S22',
index: 0,
sql: 'SELECT `id`, `activityType`, `customData`, `createdAt`, `updatedAt`, `activityId` FROM `activitiesTemplates` AS `ActivitiesTemplate` WHERE `ActivitiesTemplate`.`id` = NULL LIMIT 1;' },
sql: 'SELECT `id`, `activityType`, `customData`, `createdAt`, `updatedAt`, `activityId` FROM `activitiesTemplates` AS `ActivitiesTemplate` WHERE `ActivitiesTemplate`.`id` = NULL LIMIT 1;' },
这是mySQL数据库/关系的错误吗?或者在我的Node.js代码中的某个地方?
在数据库表格中,我没有字段名称" activityId
"。我还将代码中的每个实例从activityId
更改为id
(表中确实存在的列)。
进行更改后,我停止了服务器。我做了npm update
,然后重新启动了服务器;但是,控制台会记录上面的错误。