AspNetCore.Identity.Mongo icon indicating copy to clipboard operation
AspNetCore.Identity.Mongo copied to clipboard

fix migration 5 -> 6 not run

Open jlg4 opened this issue 4 years ago • 4 comments

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?

jlg4 avatar Nov 04 '21 20:11 jlg4

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

gottscj avatar Nov 05 '21 11:11 gottscj

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 avatar Nov 05 '21 14:11 vova3211

And of course, thanks for your contribution ;)

vova3211 avatar Nov 05 '21 14:11 vova3211

@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.

vova3211 avatar Nov 05 '21 14:11 vova3211