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

run alter commands only if able to run alter commands, ignore inserts if already inserted #6831

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

DAcodedBEAT
Copy link
Contributor

@DAcodedBEAT DAcodedBEAT commented Jan 24, 2024

Description & Issue number it closes

this should hopefully help in bad migration scenarios as seen in gitter earlier (see https://matrix.to/#/!xSsEgXcTcVSgRZMDNu:gitter.im/$tBVJrJndO9EGSj2Pw_VESpzFVEJk8bzUvqCE65sFHEY?via=gitter.im&via=matrix.org&via=llamarific.social for more context)

How to test the changes?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@DAcodedBEAT
Copy link
Contributor Author

@MrClever let me know what you think about this - hopefully this can help the next time someone has DB migration issues, where we can just ask someone to replay a migration script

Copy link
Collaborator

@MrClever MrClever left a comment

Choose a reason for hiding this comment

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

I like the approach and I think it should avoid most of the failed upgrade scenarios we've seen previously. Will have to wait and see. Nice work!

@DAcodedBEAT DAcodedBEAT merged commit dfd831a into master Jan 29, 2024
3 of 4 checks passed
@DAcodedBEAT DAcodedBEAT deleted the replayable-migrations branch January 29, 2024 03:54
@DAcodedBEAT DAcodedBEAT added this to the vNext milestone Jan 31, 2024
@DawoudIO
Copy link
Contributor

DawoudIO commented Mar 9, 2024

ya when testing the upgrade this did not work, did you test the upgrade and if that worked, which db version did you test with. On my docker setup this did not work

@DawoudIO
Copy link
Contributor

DawoudIO commented Mar 9, 2024

if this function is going to be useful, we should keep it and not recreate it over and over... or put it in a file that run pre and post each release where it is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants