laravel-permission icon indicating copy to clipboard operation
laravel-permission copied to clipboard

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

Open zulhelmi opened this issue 4 years ago • 1 comments

Illuminate\Database\QueryException

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (esi.users, CONSTRAINT users_role_id_foreign FOREIGN KEY (role_id) REFERENCES roles (id)) (SQL: delete from roles)

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, CONSTRAINT users_role_id_foreign FOREIGN KEY (role_id) REFERENCES roles (id))")

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

zulhelmi avatar Jul 24 '20 02:07 zulhelmi

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

Baumgarten2020 avatar Jan 21 '21 18:01 Baumgarten2020