Fix logic when generating recovery codes and update migration

This commit is contained in:
Dane Everitt 2020-07-02 22:11:07 -07:00
parent a998b463e3
commit c522935403
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 47 additions and 33 deletions

View file

@ -15,7 +15,11 @@ class CreateUserRecoveryTokensTable extends Migration
{
Schema::create('recovery_tokens', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->unsignedInteger('user_id');
$table->string('token');
$table->timestamp('created_at')->nullable();
$table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
});
}