From 091aa7d8823cfd2b81b32344ea273120e442192d Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 2 Jan 2023 08:45:35 -0600 Subject: [PATCH] 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 --- .../2014_10_12_100000_create_password_resets_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index fcacb80b..e5f1397c 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -14,7 +14,7 @@ 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(); });