Skip to content

Commit 091aa7d

Browse files
authored
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
1 parent ca01443 commit 091aa7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

database/migrations/2014_10_12_100000_create_password_resets_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public function up()
1515
{
1616
Schema::create('password_resets', function (Blueprint $table) {
17-
$table->string('email')->index();
17+
$table->string('email')->primary();
1818
$table->string('token');
1919
$table->timestamp('created_at')->nullable();
2020
});

0 commit comments

Comments
 (0)