| @@ 7-41 (lines=35) @@ | ||
| 4 | use Illuminate\Database\Migrations\Migration; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateOAuthAccessTokenScopeTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('oauth2_access_token_scope', function(Blueprint $table) { |
|
| 17 | $table->char('access_token_id', 80); |
|
| 18 | $table->string('scope_id'); |
|
| 19 | ||
| 20 | $table->foreign('access_token_id') |
|
| 21 | ->references('id')->on('oauth2_access_tokens') |
|
| 22 | ->onUpdate('cascade') |
|
| 23 | ->onDelete('cascade'); |
|
| 24 | ||
| 25 | $table->foreign('scope_id') |
|
| 26 | ->references('id')->on('oauth2_scopes') |
|
| 27 | ->onUpdate('cascade') |
|
| 28 | ->onDelete('cascade'); |
|
| 29 | }); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Reverse the migrations. |
|
| 34 | * |
|
| 35 | * @return void |
|
| 36 | */ |
|
| 37 | public function down() |
|
| 38 | { |
|
| 39 | Schema::drop('oauth2_access_token_scope'); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 7-41 (lines=35) @@ | ||
| 4 | use Illuminate\Database\Migrations\Migration; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateOAuthAuthCodeScopeTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('oauth2_auth_code_scope', function(Blueprint $table) { |
|
| 17 | $table->char('auth_code_id', 80); |
|
| 18 | $table->string('scope_id'); |
|
| 19 | ||
| 20 | $table->foreign('auth_code_id') |
|
| 21 | ->references('id')->on('oauth2_auth_codes') |
|
| 22 | ->onUpdate('cascade') |
|
| 23 | ->onDelete('cascade'); |
|
| 24 | ||
| 25 | $table->foreign('scope_id') |
|
| 26 | ->references('id')->on('oauth2_scopes') |
|
| 27 | ->onUpdate('cascade') |
|
| 28 | ->onDelete('cascade'); |
|
| 29 | }); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Reverse the migrations. |
|
| 34 | * |
|
| 35 | * @return void |
|
| 36 | */ |
|
| 37 | public function down() |
|
| 38 | { |
|
| 39 | Schema::drop('oauth2_auth_code_scope'); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 7-41 (lines=35) @@ | ||
| 4 | use Illuminate\Database\Migrations\Migration; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateOAuthClientScopeTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('oauth2_client_scope', function(Blueprint $table) { |
|
| 17 | $table->char('client_id', 36); |
|
| 18 | $table->string('scope_id'); |
|
| 19 | ||
| 20 | $table->foreign('client_id') |
|
| 21 | ->references('id')->on('oauth2_clients') |
|
| 22 | ->onUpdate('cascade') |
|
| 23 | ->onDelete('cascade'); |
|
| 24 | ||
| 25 | $table->foreign('scope_id') |
|
| 26 | ->references('id')->on('oauth2_scopes') |
|
| 27 | ->onUpdate('cascade') |
|
| 28 | ->onDelete('cascade'); |
|
| 29 | }); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Reverse the migrations. |
|
| 34 | * |
|
| 35 | * @return void |
|
| 36 | */ |
|
| 37 | public function down() |
|
| 38 | { |
|
| 39 | Schema::drop('oauth2_client_scope'); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||