fix(backend): reconcile pause-state migrations (#526) + keep CI green (#527) - #586
Merged
ogazboiz merged 2 commits intoMay 29, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related backend fixes that unblock the production deploy path and the Backend CI signal.
#526 — Duplicate pause-state migrations break
prisma migrate deployTwo migrations added the same
isPaused/pausedAt/totalPausedDurationcolumns toStream, so a freshprisma migrate deployfailed on the second withcolumn "isPaused" already exists.20260428000000_add_pause_state_fieldsis now the single source of truth for the pause-state columns.ADD COLUMNs from20260428161500_add_stream_pause_fields, leaving only theStream_isPaused_idxindex (CREATE INDEX IF NOT EXISTS).20260428000000_add_stream_event_unique_constraint→20260428000001_*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/upsertentries must stay (they back the worker's duplicate-event guard at ~L360/L558).Notes
migration_lock.tomlsqlite/postgres mismatch is intentionally out of scope (tracked separately).migrate deploy.Closes #526
Closes #527
🤖 Generated with Claude Code