2021-07-17 17:26:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2021-08-07 23:10:24 +00:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2021-07-17 17:26:30 +00:00
|
|
|
|
|
|
|
class AddWebauthn extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('webauthn_keys', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->unsignedInteger('user_id');
|
|
|
|
|
|
|
|
$table->string('name')->default('key');
|
2021-07-17 17:47:07 +00:00
|
|
|
$table->string('credentialId', 255);
|
2021-07-17 17:26:30 +00:00
|
|
|
$table->string('type', 255);
|
|
|
|
$table->text('transports');
|
2021-07-17 17:47:07 +00:00
|
|
|
$table->string('attestationType', 255);
|
|
|
|
$table->text('trustPath');
|
2021-07-17 17:26:30 +00:00
|
|
|
$table->text('aaguid');
|
2021-07-17 17:47:07 +00:00
|
|
|
$table->text('credentialPublicKey');
|
2021-07-17 17:26:30 +00:00
|
|
|
$table->integer('counter');
|
|
|
|
$table->timestamps();
|
|
|
|
|
|
|
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
2021-07-17 17:47:07 +00:00
|
|
|
$table->index('credentialId');
|
2021-07-17 17:26:30 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('webauthn_keys');
|
|
|
|
}
|
|
|
|
}
|