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 @@
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('password_resets', function (Blueprint $table) {
|
Schema::create('password_resets', function (Blueprint $table) {
|
||||||
$table->string('email')->index();
|
$table->string('email')->primary();
|
||||||
$table->string('token');
|
$table->string('token');
|
||||||
$table->timestamp('created_at')->nullable();
|
$table->timestamp('created_at')->nullable();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue