Skip to content

fix migration 5 -> 6 not run#114

Merged
matteofabbri merged 1 commit intomatteofabbri:masterfrom
gottscj:fix-migration
Feb 7, 2024
Merged

fix migration 5 -> 6 not run#114
matteofabbri merged 1 commit intomatteofabbri:masterfrom
gottscj:fix-migration

Conversation

@jlg4
Copy link

@jlg4 jlg4 commented Nov 4, 2021

What does this implement/fix? Explain your changes.

  • fixes if DatabaseVersion == 4, migration 5 -> 6 will not run resulting in invalid schema.
  • adds build.yml github action which builds and runs test on PR's and push'es to master branch.

Does this close any currently open issues?
no, addresses #81

Mention issue using basic-writing-and-formatting-syntax#referencing-issues-and-pull-requests

Any relevant logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Where has this been tested?

unit test

.Net Core Version:
net5
Does this introduce a breaking change?

  • Yes
  • [ x] No

Any other comments?

fixes if DatabaseVersion == 4, migration 5 -> 6 will not run resulting in invalid schema.

adds build.yml github action which builds and runs test on PR's and push'es to master branch.

also addresses  matteofabbri#81
@gottscj
Copy link
Contributor

gottscj commented Nov 5, 2021

as shown here: we are missing migration 5.
I did it manually, but it screwed our deployment to prod, as our staging environment did get migration 5.

image

@vova3211
Copy link
Collaborator

vova3211 commented Nov 5, 2021

Hi @jlg4 !
You are right, that because after first migration lastHistory.DatabaseVersion should be increased. Then next migration will be applied also.

Your functionality looks fine, but need more time to review it more precisely.

I'll add hotfix to increase lastHistory.DatabaseVersion after each migration for now. So it won't broke anyone db, and will back to review asap.

@vova3211
Copy link
Collaborator

vova3211 commented Nov 5, 2021

And of course, thanks for your contribution ;)

@vova3211
Copy link
Collaborator

vova3211 commented Nov 5, 2021

@jlg4 new nuget package ready 8.3.3

BUT it won't fix your db automatically.
To get all working delete last migration record with DatabaseVersion = 6. Then deploy you app with new lib version.

@matteofabbri matteofabbri merged commit 8d21610 into matteofabbri:master Feb 7, 2024
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.

4 participants