修改内建数据库字段报错

* 描述问题

系统已经搭建运行,并且能正常使用,但是我要修改一个表的某个类型字段时,会提示莫名提示某个字段是无效的默认定义值(字段名会变,但是好像均为 date 类型的),修改的内容(不限于 date 类型,包括其他信息)能生效。

* 运行环境

  • NocoBase 版本: v1.3.40-beta,后来升级到 v1.3.46-beta,现象依旧
  • 数据库种类与版本: mysql
  • 操作系统: Windows 10
    -浏览器及版本 Edge 130.0.2849.68
  • 部署方式: docker-compose
  • Docker 镜像版本: v1.3.46-beta
  • NodeJS 版本: 无

如何重现

系统正常使用一段时间后,想添加内建数据表下拉菜单的内容。

预期行为

不应该报错,并且能添加和修改内容。

截图

日志

{“level”:“error”,“message”:“Cannot read properties of undefined (reading ‘collection’)”,“meta”:{“err”:“TypeError: Cannot read properties of undefined (reading ‘collection’)\n at listWithPagination (/app/nocobase/node_modules/@nocobase/actions/lib/actions/list.js:55:48)\n at list (/app/nocobase/node_modules/@nocobase/actions/lib/actions/list.js:99:11)\n at dispatch (/app/nocobase/node_modules/koa-compose/index.js:42:32)\n at middleware (/app/nocobase/node_modules/@nocobase/plugin-workflow-action-trigger/dist/server/ActionTrigger.js:59:11)\n at dispatch (/app/nocobase/node_modules/koa-compose/index.js:42:32)\n at dataTemplate (/app/nocobase/node_modules/@nocobase/server/lib/middlewares/data-template.js:36:9)\n at dispatch (/app/nocobase/node_modules/koa-compose/index.js:42:32)\n at parseVariables (/app/nocobase/node_modules/@nocobase/server/lib/middlewares/parse-variables.js:88:9)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”},“module”:“student”,“submodule”:“list”,“method”:“error-handler”,“app”:“main”,“reqId”:“a8e7420d-bdb6-4a86-a379-e4b8dba37c09”,“dataSourceKey”:“main”,“timestamp”:“2024-11-08 10:29:24”}

{“level”:“error”,“message”:“Invalid default value for ‘enrollment’”,“meta”:{“err”:“Error\n at Query.run (/app/nocobase/node_modules/sequelize/lib/dialects/mysql/query.js:52:25)\n at /app/nocobase/node_modules/sequelize/lib/sequelize.js:315:28\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async _SyncRunner.handleDefaultValues (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:197:11)\n at async _SyncRunner.runSync (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:93:5)\n at async student.sync (/app/nocobase/node_modules/@nocobase/database/lib/model.js:57:12)\n at async _Collection.sync (/app/nocobase/node_modules/@nocobase/database/lib/collection.js:559:7)\n at async _AsyncEmitter. (/app/nocobase/node_modules/@nocobase/plugin-data-source-main/dist/server/server.js:234:9)\n at async _AsyncEmitter.emitAsync (/app/nocobase/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.js:63:7)\n at async _HasManyRepository.update (/app/nocobase/node_modules/@nocobase/database/lib/relation-repository/multiple-relation-repository.js:152:9)”},“module”:“collections/student/fields”,“submodule”:“update”,“method”:“error-handler”,“app”:“main”,“reqId”:“5196f075-49eb-47e1-90f2-c5d09c7c8f9c”,“dataSourceKey”:“main”,“timestamp”:“2024-11-08 10:30:00”}

{“level”:“error”,“message”:“Invalid default value for ‘date’”,“meta”:{“err”:“Error\n at Query.run (/app/nocobase/node_modules/sequelize/lib/dialects/mysql/query.js:52:25)\n at /app/nocobase/node_modules/sequelize/lib/sequelize.js:315:28\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async _SyncRunner.handleDefaultValues (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:197:11)\n at async _SyncRunner.runSync (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:93:5)\n at async follow.sync (/app/nocobase/node_modules/@nocobase/database/lib/model.js:57:12)\n at async _Collection.sync (/app/nocobase/node_modules/@nocobase/database/lib/collection.js:559:7)\n at async _AsyncEmitter. (/app/nocobase/node_modules/@nocobase/plugin-data-source-main/dist/server/server.js:234:9)\n at async _AsyncEmitter.emitAsync (/app/nocobase/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.js:63:7)\n at async _HasManyRepository.update (/app/nocobase/node_modules/@nocobase/database/lib/relation-repository/multiple-relation-repository.js:152:9)”},“module”:“collections/student/fields”,“submodule”:“update”,“method”:“error-handler”,“app”:“main”,“reqId”:“63ee0dc8-220c-48a4-a783-ca2c9ae4ce0a”,“dataSourceKey”:“main”,“timestamp”:“2024-11-08 10:30:16”}

{“level”:“error”,“message”:“Invalid default value for ‘date’”,“meta”:{“err”:“Error\n at Query.run (/app/nocobase/node_modules/sequelize/lib/dialects/mysql/query.js:52:25)\n at /app/nocobase/node_modules/sequelize/lib/sequelize.js:315:28\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async _SyncRunner.handleDefaultValues (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:197:11)\n at async _SyncRunner.runSync (/app/nocobase/node_modules/@nocobase/database/lib/sync-runner.js:93:5)\n at async follow.sync (/app/nocobase/node_modules/@nocobase/database/lib/model.js:57:12)\n at async _Collection.sync (/app/nocobase/node_modules/@nocobase/database/lib/collection.js:559:7)\n at async _AsyncEmitter. (/app/nocobase/node_modules/@nocobase/plugin-data-source-main/dist/server/server.js:234:9)\n at async _AsyncEmitter.emitAsync (/app/nocobase/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.js:63:7)\n at async _HasManyRepository.update (/app/nocobase/node_modules/@nocobase/database/lib/relation-repository/multiple-relation-repository.js:152:9)”},“module”:“collections/student/fields”,“submodule”:“update”,“method”:“error-handler”,“app”:“main”,“reqId”:“14c4721f-1dad-4efa-ae48-48e3e812e538”,“dataSourceKey”:“main”,“timestamp”:“2024-11-08 10:30:20”}