-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Description:
When using PostgresStorage::setup() alongside application-level sqlx migrations on the same database, the two migrators share the same _sqlx_migrations table. Apalis's internal migrator only knows its own 2 migrations, so when it encounters user-defined migration entries in the table, it panics with:
migration XXXXXXXXXXXXXXX was previously applied but is missing in the resolved migrations
Suggested fix:
- Expose a way to pass a custom migrations table name or schema to
PostgresStorage::setup(), or - Internally call
.set_ignore_missing(true)on Apalis's sqlxMigrator, or - Document that a separate database/schema is required when coexisting with user migrations
Expected behavior
Apalis should ignore migration entries it doesn't own, similar to sqlx's --ignore-missing / .set_ignore_missing(true) flag.
Steps to reproduce
- Run app migrations via
sqlx::migrate!().run(&pool)— records N migrations in_sqlx_migrations - Call
PostgresStorage::setup(&pool)— Apalis sees unknown entries and errors out
Version
1.0.0-rc.x
Environment
- OS: Linux sandwitch 6.19.2-2-cachyos V0.3 apalis#1 SMP PREEMPT_DYNAMIC Mon, 16 Feb 2026 20:41:55 +0000 x86_64 GNU/Linux
- Rust version: 1.90
- Cargo version: 1.90
Relevant log output
{"timestamp":"2026-02-28T11:56:24.712192Z","level":"ERROR","fields":{"message":"failed to establish connection to db: migration 20260106165349 was previously applied but is missing in the resolved migrations"},"target":"family_cloud::jobs"}
test delete::delete_list_of_folders ... FAILEDAdditional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working