Skip to content

fix(migrations): duplicate name test fails — unique index missing #3454

@PierreBrisorgueil

Description

@PierreBrisorgueil

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 }).

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