Symptom
modules/core/tests/migrations.integration.tests.js — test "should reject duplicate migration names" fails. recordMigration() resolves instead of rejecting on duplicate names.
Root cause
The Migration model schema likely lacks a unique index on name, so Migration.create() doesn't throw a duplicate key error.
Observed in
- comes-io/trawl_node CI (intermittent, 1/2052 tests)
- Reproduced on master after clean pull
Expected fix
Add unique: true to the name field in the Migration model schema, or add schema.index({ name: 1 }, { unique: true }).
Symptom
modules/core/tests/migrations.integration.tests.js— test "should reject duplicate migration names" fails.recordMigration()resolves instead of rejecting on duplicate names.Root cause
The Migration model schema likely lacks a unique index on
name, soMigration.create()doesn't throw a duplicate key error.Observed in
Expected fix
Add
unique: trueto thenamefield in the Migration model schema, or addschema.index({ name: 1 }, { unique: true }).