Better implementation for mongodb.SetVersion
Is your feature request related to a problem? Please describe. Do we really need to drop the migrations collection everytime we want to set the version here, can't we just run an update call? This requires giving drop permissions to service which wants to run such migrations which I think is an unnecessary thing to do.
Describe the solution you'd like We can just run an update operation instead I propose.
migrationsCollection.UpdateOne(context.TODO(), bson.D{}, bson.M{"version": version, "dirty": dirty}
Describe alternatives you've considered
_
Additional context
_
This requires giving drop permissions to service which wants to run such migrations which I think is an unnecessary thing to do.
Good point, but there's also the migrate drop command which will probably need drop permissions. Anyways, it makes sense to me if you didn't want to give migrate drop permissions. Feel free to open a PR with this change. You'll need to do an upsert.
Would do, thanks for responding