Skip to content

uuid support? #615

@abedcodes

Description

@abedcodes

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 👍

Activity

abedcodes

abedcodes commented on Mar 20, 2025

@abedcodes
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

armin-salihovic commented on Apr 5, 2025

@armin-salihovic

Implemented in #617

abedcodes

abedcodes commented on Apr 6, 2025

@abedcodes
Author

thanks for your time 🎉👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @armin-salihovic@abedcodes

        Issue actions

          uuid support? · Issue #615 · lazychaser/laravel-nestedset