Skip to content

Wheels migration with foreign key fails on Linux. No function with name addForeignKeyOptions #2876

Description

@teleotic

Describe the bug
Wheels migration command fails when running a migration involving foreign key definitions. Running wheels migrate latest results in an error:

Running migration: latest...
Migrating from 0 up to 20260605110522.

-------- 20260605110522_create_products_table --------------
Error migrating to 20260605110522.
Component [wheels.databaseAdapters.PostgreSQL.PostgreSQLMigrator] has no function with name [addForeignKeyOptions]

To Reproduce
Steps to reproduce the behavior:

  1. wheels new test_app
  2. cd test_app
  3. wheels generate scaffold Post title body:text publishedAt:datetime --belongsTo=author
  4. wheels migrate latest
  5. See error

Expected behavior
Successful migration with creation of database table including a foreign key column.

Desktop

  • OS: Ubuntu 26.04 LTS
  • 4.0.2, 4.0.3-snapshot.1991 (bleeding-edge),

Additional context
Ran into this error with a more complicated model. This was the most direct reproduction method I found.

Error does NOT occur on Windows, with the same Wheels version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions