GoSimplicity commented on issue #8564: URL: https://github.com/apache/incubator-devlake/issues/8564#issuecomment-3256625051
> ### Search before asking > * [x] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues. > > ### What happened > Starting from v1.0.2 (and still present in latest), DevLake fails to start when using PostgreSQL because the migration plugins/q_dev/models/migrationscripts/20250320_modify_file_meta.go runs a MySQL-specific ALTER TABLE ... MODIFY statement. > > This causes the DB migration process to panic immediately on startup, blocking usage of the app. > > ### What do you expect to happen > Expected Behavior: DB migrations should succeed on PostgreSQL (as supported in prior versions like v1.0.2-beta8). > > ### How to reproduce > Steps to Reproduce: > > 1. Use PostgreSQL as the DevLake database. > 2. Run DevLake v1.0.2 or later (ensure image version is v1.0.2). > 3. Observe the startup migration step. > > Expected Behaviour: DB migrations should succeed on PostgreSQL (as supported in prior versions like v1.0.2-beta8). > > Actual Behaviour (Error Log): > > ``` > ERROR: syntax error at or near "MODIFY" (SQLSTATE 42601) > failed to modify processed_time column > panic recovered: > github.com/apache/incubator-devlake/plugins/q_dev/models/migrationscripts.(*modifyFileMetaTable).Up > /app/plugins/q_dev/models/migrationscripts/20250320_modify_file_meta.go:38 > ``` > > ### Anything else > Root Cause: The migration contains this SQL: `sql := "ALTER TABLE _tool_q_dev_s3_file_meta MODIFY processed_time DATETIME NULL"` > > * MODIFY is MySQL/MariaDB-specific and not valid PostgreSQL syntax. > * DATETIME is also a MySQL type; PostgreSQL uses TIMESTAMP. > This breaks PostgreSQL migrations and blocks DevLake startup. > > Environment: > > * DevLake: v1.0.2+ > * Database: PostgreSQL (fails) > * Last known working: v1.0.2-beta8 > > Impact: Blocks DB migration process on PostgreSQL → prevents DevLake from starting. > > ### Version > v1.0.2+ > > ### Are you willing to submit PR? > * [ ] Yes I am willing to submit a PR! > > ### Code of Conduct > * [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) I resolved the compatibility issue of the PostgreSQL migration by replacing the MySQL-specific syntax with the SQL that supports the dialect and adding idempotency checks. The PR has been submitted. -- 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: dev-unsubscr...@devlake.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org