SRoddis/Mongo.Migration

Question about automatically insert

bryht opened this issue ยท 11 comments

bryht commented

Hi, Sean
Thanks for your great job on this project, we are thinking about using it on our project. But we are considering migration database too. Just like your future task.

  1. Automatically insert after migrating. So migration is done only once.
    Do you have plan about finishing this?

Hey Bryht,

thank you mate!
Currently I have a lot to do on work. But I will have a look on the implementation in this month I think.

The Problem with the automatically insert is, that it has some performance challenges. I implemented a first try, but the performance was rly bad.
I think i will need some time to find a good solution.

I wanted to add a tooling, where you can update the whole database, from time to time. Whould that help you?

Cheers,
Sean

bryht commented

Hi Sean,

Thanks for your quick reply.
Take your time, no worry about us.
But for your question, yes, a tool could be great, if it can be an extension in startup.cs, then would be perfect, or throw some events when migrations in code is different with migration records in db. In our scenario, we want to update database once when it start, then no more migration operations afterwards. Hope this could give you some clues.

Best wishes,
Ming

Hey Bryht,

sounds like a โ€žquick-winโ€œ. I would create a normal extension for the startup.cs in .netcore which you can use?
What kind of Framework do you use for the application? Is it .netcore?

Cheers,
Sean

bryht commented

Hi Sean,
Yes, it would be great. we are using .net core 2.2
Thanks for your time and effort.
If you have any burden you want to share, let us know, we may can help too.

Best wishes,
Ming

Hey Bryht,

I'm sorry you have not heard from me for so long. I had more to do than I thought. I started implementing "Migration on Startup". I'm going to add a startup filter for .netcore in the coming days.

I keep you updated.

greetings Sean Roddis

bryht commented

Hi Sean,

No worry about that, take your time. It is great that you have made progress. I saw the commits you have done, they are great. Perfect for us.

Best wishes,
Ming

Hey Bryht,
I uploaded a new version of mongo.migration this weekend. I will adept the documentation this week.

But you can already test it. If you have any feedback let me know. I will close this Issue in 2 weeks, if you have no feedback.

Cheers,
Sean Roddis

bryht commented

Cool, will try it.

bryht commented

Hi Sean,
I have tried it, it`s cool.
but have some questions:

  1. have some confusion about CurrentVersion and CollectionVersion?
  2. my environment is .net core 2.2, hasn`t .net 4.7, then the IStartupFilter seems have some problem, even download the newest project, and just run "Mongo.Migration.Demo.WebCore" , still have the error.

Best wishes,
Ming

Hey Bryht,

  1. I will update the documentation this week. The CollectionVersion sets the version for the Collection. Every document in that collection will be migratet to that version on StartUp. The CurrentVersion gives you the possibility to set a version that will be migratet on runtime. The naming might not be the best.
    I will think about a better naming.

  2. I will check that.

Thanks for the Feeback,
cheers Sean

Hey Bryht,

the error should be fixed now. Please have a look at the Readme, some of the attribute have been renamed.

If you have some other Feedback let me know.

Cheers, Sean Roddis