amiryousefi / laravel-permission

Easy and flexible Laravel authorization and roles permissions management
MIT License
47 stars 11 forks source link

Error when try use php artisan permissions:generate --fresh #6

Open zulhelmi opened 4 years ago

zulhelmi commented 4 years ago

Illuminate\Database\QueryException

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (esi.users, CONSTRAINTusers_role_id_foreignFOREIGN KEY (role_id) REFERENCESroles(id)) (SQL: delete fromroles)

at C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671

    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675| 

1 C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:489 PDOException::("SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (esi.users, CONSTRAINTusers_role_id_foreignFOREIGN KEY (role_id) REFERENCESroles(id))")

2 C:\laragon\www\esi\vendor\laravel\framework\src\Illuminate\Database\Connection.php:489 PDOStatement::execute()

Baumgarten2020 commented 3 years ago

Hello,
Regarding the bug : The down function use "permission" instead of permissions