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

Slug unique integrity constraint violation #134

Closed
Z3d0X opened this issue Feb 3, 2024 · 0 comments · Fixed by #135
Closed

Slug unique integrity constraint violation #134

Z3d0X opened this issue Feb 3, 2024 · 0 comments · Fixed by #135

Comments

@Z3d0X
Copy link
Owner

Z3d0X commented Feb 3, 2024

Original PR #133

Problem:
The application threw an exception for a duplicate entry for the key pages.pages_slug_unique when attempting to insert a new page with the same slug as an existing page, but with a different parent.

Solution:
The unique index on the slug column has been removed, and a new compound unique index has been introduced on the combination of slug and parent_id columns. This allows the same slug to be used as long as it has a different parent, thus ensuring unique URLs for different page hierarchies while avoiding the integrity constraint violation.

Original PR was closed because it updated the existing migration file, this way would for new installations of this package. To solve this issue for existing applications using this package a new migration must be created, for the proposed solution

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

Successfully merging a pull request may close this issue.

1 participant