mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
switch email to a primary key (#6064)
switching from a normal index here to a primary index works the same except for adding a `UNIQUE` constraint. The `DatabaseTokenRepository` deletes existing records with an email first, before creating a new one, so this additional constraint will be okay. https://github.com/laravel/framework/blob/9.x/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php#L88
This commit is contained in:
parent
ca01443b96
commit
091aa7d882
@ -14,7 +14,7 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user