Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration Script should delete old roles #300

Open
leprekon91 opened this issue Nov 28, 2019 · 4 comments
Open

Migration Script should delete old roles #300

leprekon91 opened this issue Nov 28, 2019 · 4 comments

Comments

@leprekon91
Copy link

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?

@leprekon91 leprekon91 changed the title Migration Script shoud delete old roles Migration Script should delete old roles Nov 28, 2019
@SimonSimCity
Copy link
Member

This is when updating from v1 to v2?

@leprekon91
Copy link
Author

After running those (one after the other):

Roles._forwardMigrate();
Roles._forwardMigrate2();

so v1 -> v2 and then immediatly v2 -> v3.

@SimonSimCity
Copy link
Member

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.

@SimonSimCity
Copy link
Member

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.

@SimonSimCity SimonSimCity added good first issue This is an easy issue that beginners can tackle to get to know the code base. help wanted v1 and removed good first issue This is an easy issue that beginners can tackle to get to know the code base. labels Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants