WPB-22811 migrate conversation codes table to postgres - #4961
Merged
battermann merged 36 commits intoJan 22, 2026
Merged
Conversation
Base automatically changed from
WPB-22811-migrate-conversation-codes-table-to-postgres
to
develop
January 16, 2026 08:39
battermann
force-pushed
the
WPB-22811-migrate-conversation-codes-table-to-postgres-main
branch
4 times, most recently
from
January 20, 2026 09:41
9aac6c1 to
337dd3c
Compare
battermann
marked this pull request as ready for review
January 20, 2026 09:50
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the conversation codes table from Cassandra to PostgreSQL, following the same pattern used for the conversation table migration. The implementation includes a PostgreSQL store, dual-write capability during migration, and a background worker to migrate existing data.
Changes:
- Added PostgreSQL implementation for conversation codes storage with appropriate schema and indexes
- Implemented dual-write pattern to write to both Cassandra and PostgreSQL during migration
- Created background worker migration task to migrate existing conversation codes from Cassandra to PostgreSQL
- Updated configuration to allow choosing storage backend (Cassandra, PostgreSQL, or migration mode)
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| postgres-schema.sql | Added conversation_codes table schema and indexes |
| libs/wire-subsystems/postgres-migrations/20260115150600-conversation-codes.sql | PostgreSQL migration script creating conversation_codes table |
| libs/wire-subsystems/src/Wire/CodeStore/Postgres.hs | PostgreSQL implementation of CodeStore operations |
| libs/wire-subsystems/src/Wire/CodeStore/DualWrite.hs | Dual-write interpreter for migration phase |
| libs/wire-subsystems/src/Wire/CodeStore/Migration.hs | Migration logic to copy codes from Cassandra to PostgreSQL |
| libs/wire-subsystems/src/Wire/Migration.hs | Shared migration utilities extracted from conversation migration |
| libs/wire-subsystems/src/Wire/CodeStore/Scope.hs | Added PostgreSQL marshalling instances for Scope |
| libs/wire-api/src/Wire/API/PostgresMarshall.hs | Added marshalling instances for Code.Key, Code.Value, and Password |
| services/galley/src/Galley/App.hs | Added interpreter selection based on configuration |
| services/background-worker/src/Wire/PostgresMigrations.hs | Added conversation codes migration worker |
| services/background-worker/src/Wire/BackgroundWorker.hs | Integrated conversation codes migration into worker lifecycle |
| integration/test/Test/Migration/ConversationCodes.hs | Integration tests for conversation codes migration |
| charts/*/values.yaml | Added conversationCodes configuration option |
| docs/src/developer/reference/config-options.md | Updated documentation for migration configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
blackheaven
requested changes
Jan 20, 2026
akshaymankar
requested changes
Jan 21, 2026
akshaymankar
left a comment
Member
There was a problem hiding this comment.
Thanks for the docs, they look good. I'd say let's move the instances to the right place, other feedback is not so important.
battermann
force-pushed
the
WPB-22811-migrate-conversation-codes-table-to-postgres-main
branch
from
January 21, 2026 14:39
08c3234 to
b49e039
Compare
blackheaven
approved these changes
Jan 21, 2026
battermann
force-pushed
the
WPB-22811-migrate-conversation-codes-table-to-postgres-main
branch
from
January 22, 2026 08:37
b49e039 to
4f14d6f
Compare
battermann
deleted the
WPB-22811-migrate-conversation-codes-table-to-postgres-main
branch
January 22, 2026 11:51
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.
https://wearezeta.atlassian.net/browse/WPB-22811
Checklist
changelog.d