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:
parent
a1b730f335
commit
5e06569615
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue