Skip to content

[Bug][Migration][Postgres] testmo and q_dev plugins use MySQL-specific BIGINT UNSIGNED in raw SQL ALTER TABLE #8867

Closed as not planned

Description

@kornelwencek-esky

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):

  1. backend/plugins/testmo/models/migrationscripts/20250629_add_scope_config_id_to_projects.go
    return db.Exec("ALTER TABLE `_tool_testmo_projects` ADD COLUMN `scope_config_id` bigint unsigned NOT NULL DEFAULT 0")

— backticks + bigint unsigned.

  1. 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:

How to reproduce

  1. Deploy DevLake v1.0.3-beta12 (or any beta from 2025-06+) with PostgreSQL 15+ as backend.
  2. Run a fresh deployment, or upgrade from v1.0.1+.
  3. Migration 20250629000001 (testmo) fails with SQLSTATE 42601.
  4. 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

Activity

  1. added
    component/pluginsThis issue or PR relates to plugins
    priority/highThis issue is very important
    severity/p0This bug blocks key user journey and function
    on May 4, 2026
  2. klesh commented on May 5, 2026

    @klesh
    Contributor

    Seems like it is covered by #8866

  3. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    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.

  4. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalecomponent/pluginsThis issue or PR relates to pluginspriority/highThis issue is very importantseverity/p0This bug blocks key user journey and functiontype/bugThis issue is a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions