Skip to content

Second-db schema is overwritten erroneously when running db:migrate #52829

@dhh

Description

@dhh

When you install Solid Queue, we add a new dedicated schema in db/queue_schema.rb. We also add an empty directory for future migrations in db/queue_migrate. If you run db:prepare, everything works as it should, after we fixed #52776. But if you run db:migrate, you get a different version of the same issue. The db/queue_schema.rb is erroneously overwritten with an empty schema.

Maybe because the queue schema wasn't loaded yet when db:migrate tried to set up the secondary db upon running db:migrate, it may just be creating the empty db, then dumping the schema for that empty db (which is empty). This is not how it works on the primary DB nor of course is how it should work.

If on a new app, you have a db/schema.rb and you have an empty db/migrate, you won't get your schema zeroed out when running db:migrate as the first db task.

See rails/solid_queue#329

cc @rafaelfranca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions