Skip to content

fix: add missing migration for mros report fields#3627

Merged
TaprootFreak merged 1 commit intodevelopfrom
fix/mros-report-fields-missing-migration
Apr 27, 2026
Merged

fix: add missing migration for mros report fields#3627
TaprootFreak merged 1 commit intodevelopfrom
fix/mros-report-fields-missing-migration

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #3621, which merged the entity columns reportCode, reason, action, indicators on Mros without a corresponding DB migration (caught by @davidleomay in #3621 (comment)).

Adds the missing migration so any environment where #3621 has run code-side without DB-schema can be brought back in sync.

Constraint names

TypeORM's auto-generated naming algorithm is <prefix>_ + sha1(tableName + "_" + columnName).substring(0, 27). Verified against the existing AddMros migration (all four DF_/PK_/FK_ constraints match). Used the same formula for the new DF_* constraint on reportCode:

```
DF_34ee1d4c60de41c251fe14b9426 // sha1('mros_reportCode').substring(0, 27)
```

So future npm run migration runs against this schema won't detect a drift.

Down

Removes the four columns and the named DEFAULT constraint in reverse order.

Test plan

  • Migration applies cleanly on DEV (existing row gets reportCode='SAR', others NULL)
  • down() reverts cleanly
  • npm run migration after this migration generates no schema diff

Follow-up to PR #3621 — the entity columns reportCode/reason/action/
indicators were merged without a corresponding migration.

Constraint names match TypeORM's auto-generated format
(DF_ + sha1('mros_<column>').substring(0, 27)) so a future
'npm run migration' run on this schema doesn't see drift.
@TaprootFreak TaprootFreak merged commit 3f1f70e into develop Apr 27, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/mros-report-fields-missing-migration branch April 27, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants