Skip to content

uuid support? #615

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

Open
abedcodes opened this issue Mar 20, 2025 · 3 comments
Open

uuid support? #615

abedcodes opened this issue Mar 20, 2025 · 3 comments

Comments

@abedcodes
Copy link

abedcodes commented Mar 20, 2025

Hi @lazychaser thanks for this amazing package. I'm using uuid as my primary keys. is there any considerations to take? i looked at the source,columns method inside NestedSet class, and parent_id column key type is unsigned big integer. using $table->nestedSet() gives no ways of setting this field type and there is nothing to publish for this package. you could build 3 columns manually in the migration but this shouldn't be the way to go.

thanks in advance 👍

@abedcodes
Copy link
Author

I managed to find a get-go solution for this, add these lines in migrations you are using $table->nestedSet() and the primary key is uuid.

        $table->unsignedInteger('_lft')->default(0);
        $table->unsignedInteger('_rgt')->default(0);
        $table->uuid('parent_id')->nullable();
        $table->index(['_lft', '_rgt', 'parent_id']);

i tested some methods and looks like everything work fine ✅

@lazychaser your confirmation makes me sleep well tonight 😄 👍

@armin-salihovic
Copy link

Implemented in #617

@abedcodes
Copy link
Author

thanks for your time 🎉👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants