laravel-nestedset
laravel-nestedset copied to clipboard
Added support, tests, sample-data for uuid
The main issues were minor after finally digging in on this.
- The parent id needed to be a string to allow for UUID
- the 'incrementing' needs to be an explicit 0 vs false because the tests failed when doing a class/array-diff check when self inspecting to see if the model was the same as the trait.
- SQLite was failing when using truncate, so I just used a delete() from the model to clear the DB on test teardown.
I thought about removing the (int) id's instead of duplicating the test suite, but it felt better knowing that it works in both cases entirely.
UUID keys must an optional feature, so you can't change default schema for everyone
I happened to run across this. There is a fine line here between the flexibility of allowing it to be used in a uuid scenario and forcing the int id's. The solution here was to convert to string which allows for the id and/or uuid to work, though in theory the lack of int type when actually using int can make it slow.
In any event, the uuid was an issue for us at the time. this is probably water under the bridge at this point.