Commit 77e895e
authored
fix(test): ensure Migration indexes exist on per-worker DBs when migrations pre-warmed (#3561)
* fix(test): ensure Migration indexes exist on per-worker DBs when migrations pre-warmed
When DEVKIT_MIGRATIONS_RAN=1 (set by globalSetup), bootstrap() skipped
migrations.run() entirely — but jest workers operate on JEST_WORKER_ID-suffixed
DBs that never had indexes created. The unique index on Migration.name was only
present on the base DB, causing duplicate-rejection assertions
(migrations.integration.tests.js) to fail on worker DBs.
Fix: in the migrationsAlreadyRan branch, call migrations.ensureMigrationIndexes()
(which delegates to Migration.syncIndexes()) to recreate the unique index on the
worker DB without re-running the migration files themselves.
Backported from trawl_node commit ce541f0f72d3 (trawl_node#1075).
* fix(test): clarify ensureMigrationIndexes comment to cover --runInBand case1 parent 478944d commit 77e895e
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
0 commit comments