Skip to content

fix(backend): reconcile pause-state migrations (#526) + keep CI green (#527) - #586

Merged
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
manoahLinks:fix/backend-migration-and-ci-fixes
May 29, 2026
Merged

fix(backend): reconcile pause-state migrations (#526) + keep CI green (#527)#586
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
manoahLinks:fix/backend-migration-and-ci-fixes

Conversation

@manoahLinks

Copy link
Copy Markdown
Contributor

Summary

Two related backend fixes that unblock the production deploy path and the Backend CI signal.

#526 — Duplicate pause-state migrations break prisma migrate deploy

Two migrations added the same isPaused / pausedAt / totalPausedDuration columns to Stream, so a fresh prisma migrate deploy failed on the second with column "isPaused" already exists.

  • 20260428000000_add_pause_state_fields is now the single source of truth for the pause-state columns.
  • Stripped the redundant ADD COLUMNs from 20260428161500_add_stream_pause_fields, leaving only the Stream_isPaused_idx index (CREATE INDEX IF NOT EXISTS).
  • Renamed 20260428000000_add_stream_event_unique_constraint20260428000001_* so the two same-prefix migrations order deterministically.

#527 — Backend CI red

The underlying test fixes already shipped in c19320a (which used "Addresses #527", a non-closing keyword, so the issue stayed open). This adds a regression-guard comment documenting why the integration mock's findUnique/upsert entries must stay (they back the worker's duplicate-event guard at ~L360/L558).

Notes

  • The migration_lock.toml sqlite/postgres mismatch is intentionally out of scope (tracked separately).
  • The migration rename rewrites migration history; safe here because the broken deploy means no environment applied these via migrate deploy.

Closes #526
Closes #527

🤖 Generated with Claude Code

manoahLinks and others added 2 commits May 29, 2026 20:56
Two migrations added the same isPaused/pausedAt/totalPausedDuration
columns to Stream, so a fresh `prisma migrate deploy` failed with
`column "isPaused" already exists` on the second one.

- Keep 20260428000000_add_pause_state_fields as the single source of
  truth for the pause-state columns.
- Strip the redundant ADD COLUMNs from 20260428161500_add_stream_pause_fields,
  leaving only the Stream_isPaused_idx index (now CREATE INDEX IF NOT EXISTS).
- Rename 20260428000000_add_stream_event_unique_constraint to
  20260428000001_* so the two same-prefix migrations order deterministically.
The indexer integration suite failed to load when the worker's
duplicate-event guard (findUnique/upsert on streamEvent) had no
matching mock methods. Add a comment so these mock entries aren't
dropped in future edits and re-break the Backend CI job.

Closes LabsCrypt#527

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ogazboiz
ogazboiz merged commit 0974e90 into LabsCrypt:main May 29, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants