jekader opened a new issue, #328:
URL: https://github.com/apache/incubator-devlake-helm-chart/issues/328
I tried deploying a fresh instance of DevLake v1.0.1 via Helm and got stuck
with a failing migration:
```
[Execute] pending scripts: 65, executed scripts: 270, total: 335"
[migrator] applying migration script add updated_date field in
_tool_azuredevops_gitrepositories:20240223170000"
"\x1b[31;1m/app/impls/dalgorm/dalgorm.go:146 \x1b[35;1mError 1060 (42S21):
Duplicate column name 'updated_date'\n\x1b[0m\x1b[33m[16.018ms]
\x1b[34;1m[rows:0]\x1b[0m ALTER TABLE _tool_azuredevops_gitrepositories add
COLUMN updated_date datetime(3) DEFAULT NULL"
failed to execute migration\n\tcaused by: Error 1060 (42S21): Duplicate
column name 'updated_date' (400)\n\tWraps: (2) Error 1060 (42S21): Duplicate
column name 'updated_date'\n\tError types: (1) *hintdetail.withDetail (2)
*mysql.MySQLError"
HTTP 400 error\n\tcaused by: error executing migration (400)\n\tWraps: (2)
Error 1060 (42S21): Duplicate column name 'updated_date' (400)\n\tWraps: (3)
Error 1060 (42S21): Duplicate column name 'updated_date'\n\tError types: (1)
*hintdetail.withDetail (2) *hintdetail.withDetail (3) *mysql.MySQLError"
```
This seems to be caused by the migration not checking if the column exists
in the first place:
https://github.com/apache/incubator-devlake/blob/main/backend/python/plugins/azuredevops/azuredevops/migrations.py#L197-L201
A workaround is removing the column manually, then re-triggering migrations
`ALTER TABLE _tool_azuredevops_gitrepositories drop COLUMN updated_date;`
A proper solution is checking if the column exists before attempting to
alter the table. This is done for some migrations but a couple are inconsistent
and should be fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]