Skip to content

Commit 140a693

Browse files
committed
wip
1 parent 128f99c commit 140a693

5 files changed

+15
-11
lines changed

database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ public function up()
1515
{
1616
Schema::create('oauth_auth_codes', function (Blueprint $table) {
1717
$table->string('id', 100)->primary();
18-
$table->bigInteger('user_id')->unsigned()->index();
19-
$table->bigInteger('client_id')->unsigned();
20-
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
18+
$table->unsignedBigInteger('user_id')->index();
19+
$table->unsignedBigInteger('client_id');
2120
$table->text('scopes')->nullable();
2221
$table->boolean('revoked');
2322
$table->dateTime('expires_at')->nullable();
23+
24+
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
2425
});
2526
}
2627

database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ public function up()
1515
{
1616
Schema::create('oauth_access_tokens', function (Blueprint $table) {
1717
$table->string('id', 100)->primary();
18-
$table->bigInteger('user_id')->unsigned()->nullable()->index();
19-
$table->bigInteger('client_id')->unsigned();
20-
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
18+
$table->unsignedBigInteger('user_id')->nullable()->index();
19+
$table->unsignedBigInteger('client_id');
2120
$table->string('name')->nullable();
2221
$table->text('scopes')->nullable();
2322
$table->boolean('revoked');
2423
$table->timestamps();
2524
$table->dateTime('expires_at')->nullable();
25+
26+
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
2627
});
2728
}
2829

database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ public function up()
1616
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
1717
$table->string('id', 100)->primary();
1818
$table->string('access_token_id', 100);
19-
$table->foreign('access_token_id')->references('id')->on('oauth_access_tokens')->onDelete('cascade');
2019
$table->boolean('revoked');
2120
$table->dateTime('expires_at')->nullable();
21+
22+
$table->foreign('access_token_id')->references('id')->on('oauth_access_tokens')->onDelete('cascade');
2223
});
2324
}
2425

database/migrations/2016_06_01_000004_create_oauth_clients_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public function up()
1515
{
1616
Schema::create('oauth_clients', function (Blueprint $table) {
1717
$table->bigIncrements('id');
18-
$table->bigInteger('user_id')->unsigned()->nullable()->index();
18+
$table->unsignedBigInteger('user_id')->nullable()->index();
1919
$table->string('name');
20-
$table->string('secret', 100);
20+
$table->string('secret', 100)->nullable();
2121
$table->text('redirect');
2222
$table->boolean('personal_access_client');
2323
$table->boolean('password_client');

database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ public function up()
1515
{
1616
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
1717
$table->bigIncrements('id');
18-
$table->bigInteger('client_id')->unsigned();
19-
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
18+
$table->unsignedBigInteger('client_id');
2019
$table->timestamps();
20+
21+
$table->foreign('client_id')->references('id')->on('oauth_clients')->onDelete('cascade');
2122
});
2223
}
2324

0 commit comments

Comments
 (0)