Skip to content

Commit 58de5b3

Browse files
committed
Add laravel/passport database migration files
These files are installed automatically when installing with `php artisan passport:install` if they don't already exist. The autogenerated files don't conform to our code style and so fails linting. Keeping correctly styled migrations files in `database/migrations/` resolves this issue. Bug: T426075
1 parent 1cd71f4 commit 58de5b3

5 files changed

Lines changed: 161 additions & 0 deletions
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
// This file is installed automatically when installing laravel/passport with `php artisan passport:install`
4+
// if it doesn't already exist. The autogenerated files don't conform to our code style and so fails linting.
5+
// Keeping correctly styled migrations files in `database/migrations/` resolves this issue.
6+
7+
use Illuminate\Database\Migrations\Migration;
8+
use Illuminate\Database\Schema\Blueprint;
9+
use Illuminate\Support\Facades\Schema;
10+
11+
return new class extends Migration {
12+
/**
13+
* Run the migrations.
14+
*/
15+
public function up(): void {
16+
Schema::create('oauth_auth_codes', function (Blueprint $table) {
17+
$table->string('id', 100)->primary();
18+
$table->unsignedBigInteger('user_id')->index();
19+
$table->unsignedBigInteger('client_id');
20+
$table->text('scopes')->nullable();
21+
$table->boolean('revoked');
22+
$table->dateTime('expires_at')->nullable();
23+
});
24+
}
25+
26+
/**
27+
* Reverse the migrations.
28+
*/
29+
public function down(): void {
30+
Schema::dropIfExists('oauth_auth_codes');
31+
}
32+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
// This file is installed automatically when installing laravel/passport with `php artisan passport:install`
4+
// if it doesn't already exist. The autogenerated files don't conform to our code style and so fails linting.
5+
// Keeping correctly styled migrations files in `database/migrations/` resolves this issue.
6+
7+
use Illuminate\Database\Migrations\Migration;
8+
use Illuminate\Database\Schema\Blueprint;
9+
use Illuminate\Support\Facades\Schema;
10+
11+
return new class extends Migration {
12+
/**
13+
* Run the migrations.
14+
*/
15+
public function up(): void {
16+
Schema::create('oauth_access_tokens', function (Blueprint $table) {
17+
$table->string('id', 100)->primary();
18+
$table->unsignedBigInteger('user_id')->nullable()->index();
19+
$table->unsignedBigInteger('client_id');
20+
$table->string('name')->nullable();
21+
$table->text('scopes')->nullable();
22+
$table->boolean('revoked');
23+
$table->timestamps();
24+
$table->dateTime('expires_at')->nullable();
25+
});
26+
}
27+
28+
/**
29+
* Reverse the migrations.
30+
*/
31+
public function down(): void {
32+
Schema::dropIfExists('oauth_access_tokens');
33+
}
34+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
// This file is installed automatically when installing laravel/passport with `php artisan passport:install`
4+
// if it doesn't already exist. The autogenerated files don't conform to our code style and so fails linting.
5+
// Keeping correctly styled migrations files in `database/migrations/` resolves this issue.
6+
7+
use Illuminate\Database\Migrations\Migration;
8+
use Illuminate\Database\Schema\Blueprint;
9+
use Illuminate\Support\Facades\Schema;
10+
11+
return new class extends Migration {
12+
/**
13+
* Run the migrations.
14+
*/
15+
public function up(): void {
16+
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
17+
$table->string('id', 100)->primary();
18+
$table->string('access_token_id', 100)->index();
19+
$table->boolean('revoked');
20+
$table->dateTime('expires_at')->nullable();
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*/
27+
public function down(): void {
28+
Schema::dropIfExists('oauth_refresh_tokens');
29+
}
30+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
// This file is installed automatically when installing laravel/passport with `php artisan passport:install`
4+
// if it doesn't already exist. The autogenerated files don't conform to our code style and so fails linting.
5+
// Keeping correctly styled migrations files in `database/migrations/` resolves this issue.
6+
7+
use Illuminate\Database\Migrations\Migration;
8+
use Illuminate\Database\Schema\Blueprint;
9+
use Illuminate\Support\Facades\Schema;
10+
11+
return new class extends Migration {
12+
/**
13+
* Run the migrations.
14+
*/
15+
public function up(): void {
16+
Schema::create('oauth_clients', function (Blueprint $table) {
17+
$table->bigIncrements('id');
18+
$table->unsignedBigInteger('user_id')->nullable()->index();
19+
$table->string('name');
20+
$table->string('secret', 100)->nullable();
21+
$table->string('provider')->nullable();
22+
$table->text('redirect');
23+
$table->boolean('personal_access_client');
24+
$table->boolean('password_client');
25+
$table->boolean('revoked');
26+
$table->timestamps();
27+
});
28+
}
29+
30+
/**
31+
* Reverse the migrations.
32+
*/
33+
public function down(): void {
34+
Schema::dropIfExists('oauth_clients');
35+
}
36+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
// This file is installed automatically when installing laravel/passport with `php artisan passport:install`
4+
// if it doesn't already exist. The autogenerated files don't conform to our code style and so fails linting.
5+
// Keeping correctly styled migrations files in `database/migrations/` resolves this issue.
6+
7+
use Illuminate\Database\Migrations\Migration;
8+
use Illuminate\Database\Schema\Blueprint;
9+
use Illuminate\Support\Facades\Schema;
10+
11+
return new class extends Migration {
12+
/**
13+
* Run the migrations.
14+
*/
15+
public function up(): void {
16+
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
17+
$table->bigIncrements('id');
18+
$table->unsignedBigInteger('client_id');
19+
$table->timestamps();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*/
26+
public function down(): void {
27+
Schema::dropIfExists('oauth_personal_access_clients');
28+
}
29+
};

0 commit comments

Comments
 (0)