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

Upgrade guide to v6 #233

Open
carestad opened this issue Jun 4, 2020 · 2 comments
Open

Upgrade guide to v6 #233

carestad opened this issue Jun 4, 2020 · 2 comments

Comments

@carestad
Copy link

carestad commented Jun 4, 2020

Is there an upgrade guide from v5 to v6 somewhere? It is not clear from the v6 PR (#229) or the release page if there is a way of upgrading without too much hassle.

It seems the old Entity model has been completely replaced, which is what is causing most of the issues here, like calling getNextAfterLastPosition(), which does not exist anymore. That isn't mentioned on the release page either, only a handful of other methods are mentioned as being deprecated, but it does not say anything about any methods being removed 😕

If the model was just refactored and methods changed names, a sort of translation table with old vs. new method names would prove useful though.

Also the removal of real_depth is an issue, and it would be nice to know how or what to replace it with 🙂

@freegbee
Copy link

I'm struggling with the missing real_depth to. But I saw there is a countAncestors() function, which probably will work in my case.

@avvertix
Copy link
Contributor

I'm updating a project that used version 5.0 of this library to version 6.0. So far my approach was to have a new and clean Laravel install to compare it against my code. Here the main changes I discovered:

  • Removed real_depth column, in my case I did not find any problem because I was not relying on it
  • Removed the EntityInterface generated when creating an entity
  • Removed joinClosureBy method from Entity (since it was a private method it made sense), all its features are now easily accessible with scopes like scopeDescendants, scopeAncestors, ...

About the getNextAfterLastPosition I believe that method was removed before version 6, but I didn't investigate the commit lists to find it out. In the new version I found getLatestPosition on the entity class which seems to return the same result.

I will add more comments if I find any other changes based on my usage scenario.

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

4 participants