即使在执行 php artisan migrate 之后,Password_resets 表仍丢失

0 postgresql laravel

我正在尝试在 laravel 中进行密码恢复,但是在插入电子邮件发送重置请求后,出现错误,指出 password_resets 不存在。

我已经尝试再次迁移,但没有任何效果。

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "password_resets" does not exist 
LINE 1: delete from "password_resets" where "email" = $1 ^ (SQL: delete from "password_resets" where "email" = blabla@gmail.com)
Run Code Online (Sandbox Code Playgroud)

小智 6

根据this,似乎为password_resets生成迁移的命令不再存在,您可以尝试使用以下命令创建新的迁移:

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePasswordResetsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('password_resets', function (Blueprint $table) {
            $table->string('email')->index();
            $table->string('token')->index();
            $table->timestamp('created_at');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('password_resets');
    }
}
Run Code Online (Sandbox Code Playgroud)