Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Wrap extension upgrades in a transaction #1665

Merged
merged 1 commit into from Sep 27, 2022
Merged

Wrap extension upgrades in a transaction #1665

merged 1 commit into from Sep 27, 2022

Conversation

jgpruitt
Copy link
Contributor

@jgpruitt jgpruitt commented Sep 22, 2022

Description

In some cases, an extension upgrade is a multi-step process. This change wraps some of those steps in an explicit transaction. Specifically, we don't want a failure to result in the extension being left at version 0.0.0

Merge requirements

Please take into account the following non-code changes that you may need to make with your PR:

  • CHANGELOG entry for user-facing changes
  • Updated the relevant documentation

@jgpruitt jgpruitt self-assigned this Sep 22, 2022
@jgpruitt jgpruitt added the Bug Something isn't working label Sep 22, 2022
@jgpruitt jgpruitt marked this pull request as ready for review September 22, 2022 15:17
@jgpruitt jgpruitt requested a review from a team as a code owner September 22, 2022 15:17
pkg/pgmodel/new_migrate.go Outdated Show resolved Hide resolved
Copy link
Contributor

@antekresic antekresic left a comment

Choose a reason for hiding this comment

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

Would it work if you wrapped the whole migration path into a single transaction? Would make this change so much better.

If not, I suggest wrapping this extension upgrade section into a single function so it makes the code cleaner.

In some cases, an extension upgrade is a multistep process.
This change wraps some of those steps in an explicit transaction.
Specifically, we don't want a failure to result in the extension
being left at version 0.0.0
@jgpruitt jgpruitt merged commit efe8eb5 into master Sep 27, 2022
@jgpruitt jgpruitt deleted the john/tx-upgrade branch September 27, 2022 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants