【发布时间】:2023-04-06 05:54:01
【问题描述】:
我有 2 个迁移表,并且已成功迁移它们。但是我忘了添加一些东西所以我尝试回滚
php artisan migrate:rollback
执行此命令后,我收到了这些错误。
[照亮\数据库\查询异常] SQLSTATE[42S02]:未找到基表或视图:1051 未知表“表名”(SQL:删除表
table name)[PDO异常] SQLSTATE [42S02]:未找到基表或视图:1051 未知表“表名”
迁移成功。但是,当我回滚时,它找不到我刚刚迁移的表。
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class OnlineDiyet extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('online_diyet',function (Blueprint $table){
$table->increments('id');
$table->string('bilgi');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('online_diyet');
}
}
这是我的第二张桌子
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Doctors extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('doctors',function (Blueprint $table) {
$table->increments('id');
$table->string('email');
$table->boolean('mailat',1);
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('online_diyet');
}
}
【问题讨论】:
-
您能向我们展示您的迁移文件吗?
-
@AliYiğit 包括向上和向下的整个迁移文件
-
我在问题上编辑了它