Problem when trying to migrate laravel-permission migrations
R00TR41Z opened this issue · 2 comments
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)
Environment (please complete the following information, because it helps us investigate better):
- OS: Linux Lite
- Version 6.6 based in ubuntu 22.04 LTS
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?
To me the problem is on seed