mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Add passkey support
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Spatie\LaravelPasskeys\Support\Config;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (Schema::hasTable('passkeys')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$authenticatableClass = Config::getAuthenticatableModel();
|
||||
$authenticatableTableName = (new $authenticatableClass)->getTable();
|
||||
|
||||
Schema::create('passkeys', function (Blueprint $table) use ($authenticatableTableName): void {
|
||||
$table->id();
|
||||
$table->unsignedInteger('authenticatable_id');
|
||||
$table->foreign('authenticatable_id', 'passkeys_authenticatable_fk')
|
||||
->references('id')
|
||||
->on($authenticatableTableName)
|
||||
->cascadeOnDelete();
|
||||
|
||||
$table->text('name');
|
||||
$table->text('credential_id');
|
||||
$table->json('data');
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('passkeys');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user