lenvoh
March 14, 2025, 2:48am
1
* 描述问题
从1.7.0 beta1升级到beta3后报错:
Migration 20250312100512-change-table-name/@nocobase /plugin-workflow-manual (up) failed: Original error: (conn=54835, no: 1072, SQLState: 42000) Key column ‘id’ doesn’t exist in table
sql: ALTER TABLE workflow_manual_tasks
DROP PRIMARY KEY, ADD PRIMARY KEY (id) - parameters: : (conn=54835, no: 1072, SQLState: 42000) Key column ‘id’ doesn’t exist in table
sql: ALTER TABLE workflow_manual_tasks
DROP PRIMARY KEY, ADD PRIMARY KEY (id) - parameters:
重启应用后报错:
(conn=54839, no: 1068, SQLState: 42000) Multiple primary key defined
sql: ALTER TABLE workflow_manual_tasks
ADD id
BIGINT auto_increment PRIMARY KEY; - parameters:
* 运行环境
如何重现
预期行为
截图
日志
chenos
March 15, 2025, 12:54am
4
lenvoh:
workflow_manual_tasks
问题已修复,等下次发版,或者手动处理,删除掉 workflow_manual_tasks 表的联合主键,然后重启容器。
nocobase:main
← nocobase:fix/migration-error
opened 12:48AM - 15 Mar 25 UTC
<!--
First of all, thank you for your contribution!
For bug fixes or other no… n-feature modifications, please base your branch on the main branch.
For new features or API modifications, please make sure your branch is based on the next branch.
Thank you!
-->
### This is a ...
- [ ] New feature
- [ ] Improvement
- [ ] Bug fix
- [ ] Others
### Motivation
### Description
<!--
Please describe the key changes made in this PR clearly and concisely,
mention any potential risks,
and provide some testing suggestions.
-->
### Related issues
### Showcase
### Changelog
| Language | Changelog |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |
### Docs
| Language | Link |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |
### Checklists
- [ ] All changes have been self-tested and work as expected
- [ ] Test cases are updated/provided or not needed
- [ ] Doc is updated/provided or not needed
- [ ] Component demo is updated/provided or not needed
- [ ] Changelog is provided or not needed
- [ ] Request a code review if it is necessary
lenvoh
March 15, 2025, 6:57am
5
我是直接删掉了整个workflow_manual_tasks表,看了下里面没有什么重要数据,重启应用后表已经重建正常了,这样后面不会有什么问题吧?
如果以前里面没数据的话,暂时可以这么处理,不过为了确保以后没有影响,检查迁移表如果没有最新的迁移数据的话,需要做一些 SQL 处理:
INSERT INTO migrations (name) values ('20250312100512-change-table-name/@nocobase/plugin-workflow-manual');
DROP TABLE IF EXISTS users_jobs;
DELETE FROM fields WHERE collection_name='users' AND name='jobs';
DELETE FROM fields WHERE collection_name='jobs' AND name='users';