Laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
Laravel: 5.5.*
在迁移中有重命名操作的时候,运行 php artisan migrate 会提示 Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found的错误信息,
可通过composer 安装 doctrine/dbal 类库,然后运行 迁移就可以了
修改 表字段的 enum值时,使用DB::statement() 方法进行修改字段的ENUM值
migration 文件中有以下代码:
Schema::table('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'social')) {
$table->enum('social',[
'weibo',
'zhihu',
'qq'
])->default('weibo')->index()->change();
}
});
运行 php artisan migrate 显示以下错误信息:
In AbstractPlatform.php line 434:
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
migration 改为:
Schema::table('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'social')) {
DB::statement("ALTER TABLE users MODIFY COLUMN social ENUM('weibo','zhihu','qq')");
}
});
然后运行php artisan migrate 就可以修改到 用户表中的social的 enum 值
Reference
Laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found的更多相关文章
- 解决laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found 错误
这个错误的原因来自于没有安装一个依赖库: 官方文档说明如下: Modifying Columns Prerequisites Before modifying a column, be sure to ...
- composer安装doctrine/dbal
composer安装doctrine/dbal composer安装doctrine/dbal,安装不成功,使用的安装命令为官方提供命令“composer require doctrine/dbal” ...
- Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb ...
- Eclipse中使用MySql遇到:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading o
在Eclipse中使用MySQL遇到了点小问题 如果对Eclipse中配置MySql还有疑问的可以参考一下这篇博客:https://blog.csdn.net/qq_38247544/article/ ...
- 安装Chrome driver/ IE driver
2014-08-15 11:38 22100人阅读 评论(0) 收藏 举报 分类: python基础学习(97) >>>安装Chrome driver chrome driver ...
- [platform]linux platform device/driver(一)--Driver是如何找到对应的device
1.platform device是怎么"自动"关联到platform driver上的? 转向linux driver有些时间了,前段时间碰到个问题,在Linux kernel ...
- spingboot启动报驱动Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of th
原因: springboot应用了最新的驱动com.mysql.cj.jdbc.Driver,这个驱动需要用mysql-connector-java包的6.x版本才可以, 而mysql-connect ...
- Windows Driver Foundation-User-Mode Driver Framework 服务不能启动(错误31)问题解决
这个错误是由于WudfPf这个服务没有启动有关,导致开机时出现SVCHOST.EXE出现,内存不能"Written"的错误, http://answers.yahoo.com/qu ...
- NetBeans IDE驱动报错The path to the driver executable must be set by the web driver.chrome.driver.system property......
问题:defaulstUserDataPath=C:\\Users\\user1\\AppData\\Local\\Google\\Chrome\\User Data\\Defaul 编译失败 解决 ...
随机推荐
- 微信小程序生命周期、页面生命周期、组件生命周期
1. 生命周期 App(全局) 位置:项目根目录app.js文件 App({ onLaunch (options) { // console.log('小程序初始化') }, onShow(optio ...
- ES5新增方法(数组,字符串,对象)
一.数组方法 迭代(遍历)方法:forEach().map().filter().some().every(): 1. array. forEach(function(value,index,arr) ...
- 浅谈Java/Android下的注解
什么是注解 java.lang.annotation,接口 Annotation,在JDK5.0及以后版本引入. 注解是代码里的特殊标记,这些标记可以在编译.类加载.运行时被读取,并执行相应的处理.通 ...
- Oracle 一个表的数据update到另一个表
A表数据 B表数据 现在要把B表 B_COSTS 的值update到A表 A_COSTS 字段 SQL语法: update a set (a.a_costs) = (select b. ...
- Oracle 拼音码函数
拼音码 select comm.fun_spellcode('数据库') from dual 结果 : SJK 函数 CREATE OR REPLACE FUNCTION COMM.FUN_SPELL ...
- Flume速览
Flume是一个分布式的.可靠的.高可用的海量日志采集.聚合和传输的系统.Java实现,插件丰富,模块分明. 数据流模型:Source-Channel-Sink 事务机制保证了消息传递的可靠性 一.基 ...
- 泛型(Java 5 开始)
前言 Java 5 开始之前,从集合读取的数据都必须进行类型转换,如果插入错误的数据就会报错. 有了泛型,编译器会自动为你的插入进行转换,并在插入时告知是否插入了类型错误的对象. 将类型由原来的具体的 ...
- 【Flutter学习】基本组件之基本列表ListView组件
一,概述 列表是前端最常见的需求. 在flutter中,用ListView来显示列表页,支持垂直和水平方向展示,通过一个属性我们就可以控制其方向,列别有以下分类 水平列表 垂直列表 数据量非常大的列表 ...
- JSTL标签的用法详解
在JSP中写Java代码是一件很恶心的事情,代码量少的话还可以,要是多的话,就蛋疼了,整个页面都是<% %>所以EL表达式和JSTL就应运而生了,这里我们注重讲解一下JSTL标签的使用: ...
- 暴力字符串hash——cf1200E
#include<bits/stdc++.h> using namespace std; #define ll long long #define N 1000005 #define mo ...