Express.js and sequelize: (node:25003) UnhandledPromiseRejec



我试图使用sequelize与sequelize-cli进行迁移,但我一直收到此错误,检查代码和结构请访问我的repo: https://gitlab.com/carlosbentz/kenzie-pet-express.

整个错误是:

Executing (default): SELECT `Animal`.`id`, `Animal`.`name`, `Animal`.`age`, `Animal`.`weight`, `Animal`.`sex`, `Animal`.`createdAt`, `Animal`.`updatedAt`, `Animal`.`GroupId`, `Group`.`id` AS `Group.id`, `Group`.`name` AS `Group.name`, `Group`.`scientific_name` AS `Group.scientific_name`, `Group`.`createdAt` AS `Group.createdAt`, `Group`.`updatedAt` AS `Group.updatedAt` FROM `Animals` AS `Animal` LEFT OUTER JOIN `Groups` AS `Group` ON `Animal`.`GroupId` = `Group`.`id`; (node:25003) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: SQLITE_ERROR: no such table: Animals
at Query.formatError (/home/bentz/projects/q4/kenzie-pet-express/node_modules/sequelize/lib/dialects/sqlite/query.js:403:16)
at Query._handleQueryResponse (/home/bentz/projects/q4/kenzie-pet-express/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
at afterExecute (/home/bentz/projects/q4/kenzie-pet-express/node_modules/sequelize/lib/dialects/sqlite/query.js:238:27)
at Statement.errBack (/home/bentz/projects/q4/kenzie-pet-express/node_modules/sqlite3/lib/sqlite3.js:14:21) (Use `node --trace-warnings ...` to show where the warning was created) (node:25003) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:25003) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

谢谢大家的帮助。

解决了,您无法删除在迁移文件中创建和更新的字段。

相关内容