Repository navigation
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
Two migration scripts use BIGINT UNSIGNED and (in one case) MySQL backticks
in raw db.Exec() ALTER TABLE statements without dialect-aware branching.
Both fail on PostgreSQL with ERROR: syntax error (SQLSTATE 42601), blocking
any upgrade path that crosses these scripts on a Postgres backend.
Affected migrations (audited at v1.0.3-beta12):
backend/plugins/testmo/models/migrationscripts/20250629_add_scope_config_id_to_projects.goreturn db.Exec("ALTER TABLE `_tool_testmo_projects` ADD COLUMN `scope_config_id` bigint unsigned NOT NULL DEFAULT 0")
— backticks + bigint unsigned.
backend/plugins/q_dev/models/migrationscripts/20251123_add_scope_config_id_to_s3_slice.go
err := db.Exec(`
ALTER TABLE _tool_q_dev_s3_slices
ADD COLUMN scope_config_id BIGINT UNSIGNED DEFAULT 0
`)
— BIGINT UNSIGNED (Postgres has no unsigned modifier).
This is the same class of bug as #8564 (closed by #8565), reproduced in
two new migrations.
Sibling migration plugins/testmo/.../20250629_add_scope_config_id.go in the
same plugin uses the portable migrationhelper.AutoMigrateTables(...)
pattern correctly — confirming this is a coding mistake, not a missing
infrastructure piece.
What do you expect to happen
Migrations should either:
- Use
migrationhelper.AutoMigrateTables(&entity{})with GORM tags (portable across MySQL/Postgres), or - Branch on
db.Dialect()for dialect-specific raw SQL (asq_dev/20250320_modify_file_meta.godoes correctly after refactor(migrations): enhance file meta migration to check column existence and nullability before modification #8565).
How to reproduce
- Deploy DevLake v1.0.3-beta12 (or any beta from 2025-06+) with PostgreSQL 15+ as backend.
- Run a fresh deployment, or upgrade from v1.0.1+.
- Migration
20250629000001(testmo) fails withSQLSTATE 42601. - Even if testmo is patched, the next blocker is
20251123000001(q_dev) with the same root cause.
Reproduced on PostgreSQL 15 managed by the Zalando operator.
Anything else
Recommendation: add a CI step that runs the full migration chain against
PostgreSQL on every PR. Most contributors use the portable helpers
correctly; these two slipped through specifically because they were
hand-written raw SQL bypassing the helpers.
Related: #8617 (teambition ORDER BY on json column — unresolved,
different root cause but blocks Postgres on the same upgrade path),
#8564 (q_dev MODIFY — fixed in #8565), #8350 (Postgres support parity
question, closed without resolution).
Version
v1.0.3-beta12
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
klesh commentedon May 5, 2026
Seems like it is covered by #8866
github-actions commentedon Jul 20, 2026
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.
github-actions commentedon Jul 31, 2026
This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.