Skip to content
This repository was archived by the owner on May 21, 2021. It is now read-only.

Commit 629d7df

Browse files
committed
Add passport migrations
1 parent dcd2901 commit 629d7df

5 files changed

+175
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateOauthAuthCodesTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('oauth_auth_codes', function (Blueprint $table) {
17+
$table->string('id', 100)->primary();
18+
$table->integer('user_id');
19+
$table->integer('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+
* @return void
30+
*/
31+
public function down()
32+
{
33+
Schema::drop('oauth_auth_codes');
34+
}
35+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateOauthAccessTokensTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('oauth_access_tokens', function (Blueprint $table) {
17+
$table->string('id', 100)->primary();
18+
$table->integer('user_id')->index()->nullable();
19+
$table->integer('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+
* @return void
32+
*/
33+
public function down()
34+
{
35+
Schema::drop('oauth_access_tokens');
36+
}
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateOauthRefreshTokensTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
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+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::drop('oauth_refresh_tokens');
32+
}
33+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateOauthClientsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('oauth_clients', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->integer('user_id')->index()->nullable();
19+
$table->string('name');
20+
$table->string('secret', 100);
21+
$table->text('redirect');
22+
$table->boolean('personal_access_client');
23+
$table->boolean('password_client');
24+
$table->boolean('revoked');
25+
$table->timestamps();
26+
});
27+
}
28+
29+
/**
30+
* Reverse the migrations.
31+
*
32+
* @return void
33+
*/
34+
public function down()
35+
{
36+
Schema::drop('oauth_clients');
37+
}
38+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateOauthPersonalAccessClientsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->integer('client_id')->index();
19+
$table->timestamps();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::drop('oauth_personal_access_clients');
31+
}
32+
}

0 commit comments

Comments
 (0)