fix(mcp): use UUID columns for Passport user references

The User model uses UUID primary keys, but the published Passport migrations
typed user_id (and the client owner morph) as bigint, so issuing a token
truncated the UUID and failed. Switch user_id to foreignUuid and the client
owner to nullableUuidMorphs.
This commit is contained in:
Víctor Falcón 2026-07-17 18:01:03 +02:00
parent a1b730f335
commit 5e06569615
4 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ return new class extends Migration
{
Schema::create('oauth_auth_codes', function (Blueprint $table) {
$table->char('id', 80)->primary();
$table->foreignId('user_id')->index();
$table->foreignUuid('user_id')->index();
$table->foreignUuid('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');

View File

@ -13,7 +13,7 @@ return new class extends Migration
{
Schema::create('oauth_access_tokens', function (Blueprint $table) {
$table->char('id', 80)->primary();
$table->foreignId('user_id')->nullable()->index();
$table->foreignUuid('user_id')->nullable()->index();
$table->foreignUuid('client_id');
$table->string('name')->nullable();
$table->text('scopes')->nullable();

View File

@ -13,7 +13,7 @@ return new class extends Migration
{
Schema::create('oauth_clients', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->nullableMorphs('owner');
$table->nullableUuidMorphs('owner');
$table->string('name');
$table->string('secret')->nullable();
$table->string('provider')->nullable();

View File

@ -13,7 +13,7 @@ return new class extends Migration
{
Schema::create('oauth_device_codes', function (Blueprint $table) {
$table->char('id', 80)->primary();
$table->foreignId('user_id')->nullable()->index();
$table->foreignUuid('user_id')->nullable()->index();
$table->foreignUuid('client_id')->index();
$table->char('user_code', 8)->unique();
$table->text('scopes');