meteor-roles
meteor-roles copied to clipboard
Migration Script should delete old roles
The migration scripts do not delete the old roles in the Roles collection:
{ "_id" : "admin", "children" : [ ] } //new role is created
{ "_id" : "u9jJZoAfaEApp6QBw", "name" : "admin" } // old role is still here
Shouldn't the old roles go the way of the dodo?
This is when updating from v1 to v2?
After running those (one after the other):
Roles._forwardMigrate();
Roles._forwardMigrate2();
so v1 -> v2 and then immediatly v2 -> v3.
Thanks. As far as I've taken a look at it, this is when updating the database from v1 to v2 ... I've just started using this library in v2 and was quite surprised this could happen 😅
Please let me know if you'll have time to look into the first update script and create a PR - I'm on holiday for about a week but can have a look at it afterwards as my other spare-time activities allow.
I've looked a bit into the update-script for another issue on this project and I do not see a reason to leave the old roles around. Still - I want to test it back and forth before removing them in the update-script. Everyone else is welcome to kick them out and provide some feedback here.
Specially helpful would it be if someone on a bigger codebase could share his experience on a forward and backward migration on 1.x to 2.x.