- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Connection.php 第 664 行:
SQLSTATE[42S01]:基表或 View 已存在:1050 表 'credit_prop_fees' 已存在(SQL:创建表credit_prop_fees
(id
int unsigned not null auto_increment 主键,fee_id
int not null,created_at
时间戳为空,updated_at
时间戳 null) 默认字符集 utf8mb4 collate utf8mb4_unicode_ci)
我有两个迁移,一个接一个这是第一个
public function up()
{
Schema::create('credit_prop_fees', function (Blueprint $table) {
$table->increments('id');
$table->integer('fee_id');
$table->timestamps();
});
}
正如您在下一次迁移中看到的,我有 dropeIfExist() 函数
public function up()
{
Schema::dropIfExists('credit_prop_fees');
Schema::create('credit_prop_fees', function (Blueprint $table) {
$table->increments('id');
$table->integer('credit_id');
$table->integer('credit_prop_id');
$table->integer('fee_type_id');
$table->integer('fee_value_id');
$table->timestamps();
});
}
我正在尝试让 php artisan 迁移如果我编写 Schema::dropIfExists('credit_prop_fees'); 为什么会收到此错误
即使当我使用tinker时,我也有null,但表已被删除C:\OSPanel\domains\laravel.bai.loc>php artisantinkerPsy Shell v0.8.17(PHP 7.1.12 — cli),作者:Justin Hileman
Schema::drop('credit_prop_fees'); => null
感谢您的回答
最佳答案
我不知道你为什么要删除新创建的表,但请尝试:
php arisan migrate:fresh
关于laravel - SQLSTATE[42S01] : Base table or view already exists: 1050 Why I can not drop the table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48230799/
我是一名优秀的程序员,十分优秀!