php - 在现有表中添加更多列,但它没有
问题描述
$ php artisan migrate
In Connection.php line 647:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre
ady exists (SQL: create table `users` (`id` int unsigned not null auto_incr
ement primary key, `name` varchar(191) not null, `email` varchar(191) not n
ull, `password` varchar(191) not null, `remember_token` varchar(100) null,
`created_at` timestamp null, `updated_at` timestamp null) default character
set utf8mb4 collate utf8mb4_unicode_ci)
In Connection.php line 449:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre
ady exists
我正在尝试在用户表中添加更多列,但我不能。在终端我写命令 php artisan migrate 但基表或视图已经存在:1050 表'用户'已经存在。我现在能做什么?
解决方案
使用 PHP artisan migrate:refresh 它将删除所有表并再次创建所有或使用 Schema::table 添加更多列
推荐阅读
- javascript - 无法使用 node.js Vue 客户端将数据发布到我的 postgresql 数据库
- java - 试图将 solr 服务器包含到我的 java 项目中并启动它
- python - 通过 open-cv 减少来自手机的不需要的图像噪声
- vb.net - 排序 Dictionary(Of List(Of Integer),List(Of Integer)) 按键
- java - 如何处理“构建工作区遇到问题”
- python - unotools 将图像插入文档(libreoffice)
- python-3.x - 输入一个单词,然后搜索单词数组以找到该单词
- java-8 - 使用 Java 8 从地图收集数据到列表
- javascript - 使用猫鼬查询某些内容时如何捕获错误
- google-chrome - 如何让 Chrome 上下文菜单不分组配置文件?