如何解决已删除的迁移文件仍在迁移
我删除了 laravel 应用程序中的一些迁移文件,但在我运行 PHP artisan migrate
命令后,它仍在迁移已删除的迁移文件。我已经尝试过 composer dump-autoload
并且清除缓存仍然相同。我错过了什么?
迁移示例:
<?PHP
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class createusersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users',function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
解决方法
已修复。它来自laravel/passport
。
运行以下工匠命令:
1. php artisan config:cache
2. php artisan config:clear
3. php artisan cache:clear
4. php artisan route:clear
5. php artisan view:clear
然后运行:
composer dump-autoload
之后运行迁移命令:
php artisan migrate:fresh
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。