【问题标题】:Express.js and sequelize: (node:25003) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: SQLITE_ERROR: no such table:Express.js 和 sequelize: (node:25003) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: SQLITE_ERROR: no such table:
【发布时间】:2021-10-19 04:13:37
【问题描述】:

我正在尝试使用 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.

感谢大家的帮助。

【问题讨论】:

    标签: node.js sqlite express sequelize.js migration


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2020-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      相关资源
      最近更新 更多