laravel - 为什么当我想 php artisan db:seed 时我不能 db:seed
问题描述
我需要帮助来解决这个问题,我似乎无法解决,因为我不知道该怎么做。请帮助调试我面临的这个播种错误。
Seeding: DefaultBlockedTypeTableSeeder
Seeding: DefaultBlockedItemsTableSeeder
Seeding: BlockedTypeTableSeeder
Seeding: BlockedItemsTableSeeder
Seeding: DefaultPermissionitemsTableSeeder
Illuminate\Database\QueryException : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'membership.permissions' doesn't exist (SQL: select * from `permissions` where `slug` = view.users and `permissions`.`deleted_at` is null limit 1)
at C:\xampp\htdocs\laravel-auth-master\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
> 669| throw new QueryException(
670| $query, $this->prepareBindings($bindings), $e
671| );
672| }
673|
Exception trace:
1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'membership.permissions' doesn't exist")
C:\xampp\htdocs\laravel-auth-master\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:63
2 PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'membership.permissions' doesn't exist")
C:\xampp\htdocs\laravel-auth-master\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:61
Please use the argument -v to see more details.
解决方案
我猜AuthServiceProvider.php
你在你的项目中定义了对数据库表感兴趣的 Gates(在这个错误中:权限),所以你必须注释这些并再次运行php artisan db:seed
,完成后,去AuthServiceProvider.php
并取消注释 Gates。
推荐阅读
- c# - 始终在 Unity 移动通知设置包中请求应用启动授权
- gulp - npm WARN 可选跳过可选依赖:fsevents@1.2.9 (node_modules\gulp\node_modules\fsevents):
- java - 查询firestore中的数组元素并将其放入Android Studio数组(CollectionReference)(whereArrayContains)
- android - LiveData 适用于 recyle 视图,但 MutableLiveData 不适用。为什么?
- c# - 如何将一串“字符串附加方程”转换为实际的字符串附加方程?
- html - 如何让我的 flexbox 垂直扩展?
- selenium-chromedriver - Chromedriver 离线网络条件似乎不会阻止 Service Worker 获取
- java - 为什么 JSON 中的现有对象显示错误“无值”
- java - 在 spark 中捕获已执行 sql 的异常
- .net - 错误 CS0246 找不到类型或命名空间名称“ErrorModel”(您是否缺少 using 指令或程序集引用?)