Skip to content

Allow running migrations outside of a transaction #1129

@jwoertink

Description

@jwoertink

A PR (1021) was started a while back, but never got finished.

The original use case was to support certain CockroachDB functionality where alter table column type was being updated. I just ran in to a case with postgres.

Caused by: CREATE INDEX CONCURRENTLY cannot run inside a transaction block (PQ::PQError)

Apparently postgres doesn't allow you to create indexes concurrently while in a transaction. So in this case, we need a way to allow you an escape hatch for your migrations. I believe that PR may be suitable enough, but we will just need some specs to test all of this. As for what the API looks like... I'm not big on the skip_transaction true syntax, but I also don't have a better idea for it so we can roll with that unless someone else has a nice idea...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions