Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility to execute migration outside of transaction

See original GitHub issue

Some SQL commands can’t be executed in the scope of transaction. E.g. psql ALTER TYPE .... I suggest to add possibility to disable wrapping particular migration in the transaction. It can be configured via some flag in the migration file name, or via special comment inside the migration, e.g. -- tx off.

I’m ready to submit PR in case this changes are welcome and we agree on configuration option.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

lecailloncommented, Feb 9, 2021

You EXEC in the comment ?

Zelioncommented, Feb 9, 2021

This is the migration script: -- evolve-tx-off EXEC StoreFileGroupTest;

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I run a migration without starting a transaction in ...
An extremely simple, Rails-version-independent (2.3, 3.2, 4.0, doesn't matter) way about this is to simply add execute("commit;") to the ...
Read more >
Run some migration revisions outside of a transaction
The problem is that 4 is an operation that can't be in a transation, specifically CREATE INDEX CONCURRENTLY from Postgres (synchronous creation ...
Read more >
Run Migrations Outside of a Transaction
When we run migrations without a transaction, it is only valid in few situations, but we'll want to do this carefully. It could...
Read more >
Migrations - Flyway
Within a single migration run, repeatable migrations are always applied last, after all pending versioned migrations have been executed.
Read more >
Applying Migrations - EF Core
Strategies for applying schema migrations to production and development databases ... Each migration is applied in its own transaction.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found