Skip to content

Allow running migrations without transactions #19

Open
akshaymankar wants to merge 6 commits into
tvh:masterfrom
wireapp:allow-no-transaction
Open

Allow running migrations without transactions #19
akshaymankar wants to merge 6 commits into
tvh:masterfrom
wireapp:allow-no-transaction

Conversation

@akshaymankar

Copy link
Copy Markdown

Resolves #17

akshaymankar added a commit to wireapp/wire-server that referenced this pull request Apr 28, 2026

@supersven supersven left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment thread src/Hasql/Migration.hs
-- cause the DB to become inconsitent. However, it might be required for
-- migrations which cannot be run in transactions, e.g. 'CREATE INDEX
-- CONCURRENTLY'.
runMigrationWithoutTransactions :: MigrationCommand -> Session (Maybe MigrationError)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this function deserves a test.

akshaymankar added a commit to wireapp/wire-server that referenced this pull request Apr 29, 2026
* Postgres: Index the parent_conv column in the conversation table

This will reduce the time it takes to delete conversations.

* PostgresMigrations: Allow running migrations without transactions

Requires upstream patch: tvh/hasql-migration#19

* Ensure index creation can be run again since it cannot be run in a transaction

* Make comment haddock

Co-authored-by: Sven Tennie <sven.tennie@wire.com>

---------

Co-authored-by: Sven Tennie <sven.tennie@wire.com>
@akshaymankar akshaymankar force-pushed the allow-no-transaction branch from b5b1d81 to 7d6f39a Compare May 5, 2026 12:29
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.

Allow running migrations without a transaction

2 participants