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

Problem when trying to migrate laravel-permission migrations #2650

Open
R00TR41Z opened this issue Apr 5, 2024 · 2 comments
Open

Problem when trying to migrate laravel-permission migrations #2650

R00TR41Z opened this issue Apr 5, 2024 · 2 comments

Comments

@R00TR41Z
Copy link

R00TR41Z commented Apr 5, 2024

Problem when trying to migrate laravel-permission migrations

Versions

  • spatie/laravel-permission package version:6.4
  • laravel/framework 10.48.4

PHP version: 8.3

Database version:

To Reproduce
Steps to reproduce the behavior:

Create new laravel project with v10.48.4

composer create-project laravel/laravel:^10

install laravel permission v6.4

composer require spatie/laravel-permission:6.4

publish packege file

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"

Here is my example code and/or tests showing the problem in my app:

php artisan migrate

Expected behavior
SQLSTATE[HY000]: General error: 1005 Can't create table Laravel.model_has_permissions (errno: 121 "Duplicate key on write or update") (Connection: mysql, SQL: alter table model_has_permissions add constraint model_has_permissions_permission_id_foreign foreign key (permission_id) references permissions (id) on delete cascade)

spatie-permission

Environment (please complete the following information, because it helps us investigate better):

  • OS: Linux Lite
  • Version 6.6 based in ubuntu 22.04 LTS
@drbyte
Copy link
Collaborator

drbyte commented Apr 18, 2024

I can't replicate this. And the test suite, which runs a lot of migrations via fresh installs ... is passing.

What database engine are you using?

@parallels999
Copy link
Contributor

To me the problem is on seed

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

3 participants