Skip to content

Wheels migration script runs against wrong Lucee instance #2878

Description

@teleotic

Describe the bug
As discovered in #2876, when working on multiple apps migration scripts may run against the wrong Lucee instance. This could result in writes going to the wrong database.

To Reproduce
Steps to reproduce the behavior:

  1. wheels new test_app_a
  2. wheels new test_app_b
  3. cd test_app_a
  4. wheels start
  5. cd ../test_app_b
  6. wheels generate scaffold Post title body:text publishedAt:datetime --belongsTo=author
  7. wheels migrate latest
  8. See that test_app_b has now run its migration against test_app_a's Lucee instance

Expected behavior
wheels migrate should refuse to run, and provide an appropriate error, if the project's associated server is not active. It should not run against another project's server.

Desktop

  • OS: Ubuntu 26.04 LTS
  • Version 4.0.2

Additional context
In my case, I was working on an app with a PostgreSQL backend. Without stopping that app's server, I created a second app to test some Wheels behavior. The second app was created with default settings, which created a SQLite database. Running a wheels migrate latest in the second app's directory without starting that app's server resulted in an error mentioning PostgreSQL.

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