Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update migrate to be transactional #1128

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hf
Copy link
Contributor

@hf hf commented Jun 6, 2023

The migrate command runs migrations one at a time, stopping until the last one that could be fully and successfully completed.

However, GoTrue is exclusively built with PostgreSQL in mind, which supports transactional DDL statements. As we've seen operating many thousands of GoTrue instances in the wild, it's much more useful for migrations between release A and A' to run fully or none at all. Thus the migrate command is refactored to run the migrations within a transaction block.

If the migrations are not able to run all at once, the command will exit with 123 which can be used as a special signal to operators that the transition from release A to A' is not compatible; and release A can continue to safely run.

@hf hf requested a review from a team as a code owner June 6, 2023 15:49
@hf hf force-pushed the hf/transactional-migrations branch 2 times, most recently from a3ef900 to 218b34f Compare June 6, 2023 16:11
@hf hf force-pushed the hf/transactional-migrations branch from 218b34f to 26f1965 Compare June 6, 2023 16:28
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.

None yet

1 participant