Skip to content

Commit c638589

Browse files
committed
Merge pull request #483 from lucadegasperi/migration
Remove AbstractMigration and database connnection
2 parents 61f91aa + 4fe5dcd commit c638589

17 files changed

+83
-127
lines changed

config/oauth2.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111

1212
return [
1313

14-
/*
15-
|--------------------------------------------------------------------------
16-
| Database Connection to use
17-
|--------------------------------------------------------------------------
18-
|
19-
| Set the default database connection to use for the repositories, when
20-
| set to default, it uses whatever connection you specified in your
21-
| laravel database config.
22-
|
23-
*/
24-
25-
'database' => 'default',
26-
2714
/*
2815
|--------------------------------------------------------------------------
2916
| Supported Grant Types

database/migrations/2014_04_24_110151_create_oauth_scopes_table.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth scopes table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthScopesTable extends AbstractMigration
21+
class CreateOauthScopesTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthScopesTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_scopes', function (Blueprint $table) {
30+
Schema::create('oauth_scopes', function (Blueprint $table) {
3031
$table->string('id', 40)->primary();
3132
$table->string('description');
3233

@@ -41,6 +42,6 @@ public function up()
4142
*/
4243
public function down()
4344
{
44-
$this->schema()->drop('oauth_scopes');
45+
Schema::drop('oauth_scopes');
4546
}
4647
}

database/migrations/2014_04_24_110304_create_oauth_grants_table.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth grants table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthGrantsTable extends AbstractMigration
21+
class CreateOauthGrantsTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthGrantsTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_grants', function (Blueprint $table) {
30+
Schema::create('oauth_grants', function (Blueprint $table) {
3031
$table->string('id', 40)->primary();
3132
$table->timestamps();
3233
});
@@ -39,6 +40,6 @@ public function up()
3940
*/
4041
public function down()
4142
{
42-
$this->schema()->drop('oauth_grants');
43+
Schema::drop('oauth_grants');
4344
}
4445
}

database/migrations/2014_04_24_110403_create_oauth_grant_scopes_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth grant scopes table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthGrantScopesTable extends AbstractMigration
21+
class CreateOauthGrantScopesTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthGrantScopesTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_grant_scopes', function (Blueprint $table) {
30+
Schema::create('oauth_grant_scopes', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->string('grant_id', 40);
3233
$table->string('scope_id', 40);
@@ -53,10 +54,10 @@ public function up()
5354
*/
5455
public function down()
5556
{
56-
$this->schema()->table('oauth_grant_scopes', function (Blueprint $table) {
57+
Schema::table('oauth_grant_scopes', function (Blueprint $table) {
5758
$table->dropForeign('oauth_grant_scopes_grant_id_foreign');
5859
$table->dropForeign('oauth_grant_scopes_scope_id_foreign');
5960
});
60-
$this->schema()->drop('oauth_grant_scopes');
61+
Schema::drop('oauth_grant_scopes');
6162
}
6263
}

database/migrations/2014_04_24_110459_create_oauth_clients_table.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth client table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthClientsTable extends AbstractMigration
21+
class CreateOauthClientsTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthClientsTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_clients', function (BluePrint $table) {
30+
Schema::create('oauth_clients', function (BluePrint $table) {
3031
$table->string('id', 40)->primary();
3132
$table->string('secret', 40);
3233
$table->string('name');
@@ -43,6 +44,6 @@ public function up()
4344
*/
4445
public function down()
4546
{
46-
$this->schema()->drop('oauth_clients');
47+
Schema::drop('oauth_clients');
4748
}
4849
}

database/migrations/2014_04_24_110557_create_oauth_client_endpoints_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth client endpoints table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthClientEndpointsTable extends AbstractMigration
21+
class CreateOauthClientEndpointsTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthClientEndpointsTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_client_endpoints', function (Blueprint $table) {
30+
Schema::create('oauth_client_endpoints', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->string('client_id', 40);
3233
$table->string('redirect_uri');
@@ -49,10 +50,10 @@ public function up()
4950
*/
5051
public function down()
5152
{
52-
$this->schema()->table('oauth_client_endpoints', function (Blueprint $table) {
53+
Schema::table('oauth_client_endpoints', function (Blueprint $table) {
5354
$table->dropForeign('oauth_client_endpoints_client_id_foreign');
5455
});
5556

56-
$this->schema()->drop('oauth_client_endpoints');
57+
Schema::drop('oauth_client_endpoints');
5758
}
5859
}

database/migrations/2014_04_24_110705_create_oauth_client_scopes_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth client scopes table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthClientScopesTable extends AbstractMigration
21+
class CreateOauthClientScopesTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthClientScopesTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_client_scopes', function (Blueprint $table) {
30+
Schema::create('oauth_client_scopes', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->string('client_id', 40);
3233
$table->string('scope_id', 40);
@@ -53,10 +54,10 @@ public function up()
5354
*/
5455
public function down()
5556
{
56-
$this->schema()->table('oauth_client_scopes', function (Blueprint $table) {
57+
Schema::table('oauth_client_scopes', function (Blueprint $table) {
5758
$table->dropForeign('oauth_client_scopes_client_id_foreign');
5859
$table->dropForeign('oauth_client_scopes_scope_id_foreign');
5960
});
60-
$this->schema()->drop('oauth_client_scopes');
61+
Schema::drop('oauth_client_scopes');
6162
}
6263
}

database/migrations/2014_04_24_110817_create_oauth_client_grants_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth client grants table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthClientGrantsTable extends AbstractMigration
21+
class CreateOauthClientGrantsTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthClientGrantsTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_client_grants', function (Blueprint $table) {
30+
Schema::create('oauth_client_grants', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->string('client_id', 40);
3233
$table->string('grant_id', 40);
@@ -54,10 +55,10 @@ public function up()
5455
*/
5556
public function down()
5657
{
57-
$this->schema()->table('oauth_client_grants', function (Blueprint $table) {
58+
Schema::table('oauth_client_grants', function (Blueprint $table) {
5859
$table->dropForeign('oauth_client_grants_client_id_foreign');
5960
$table->dropForeign('oauth_client_grants_grant_id_foreign');
6061
});
61-
$this->schema()->drop('oauth_client_grants');
62+
Schema::drop('oauth_client_grants');
6263
}
6364
}

database/migrations/2014_04_24_111002_create_oauth_sessions_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth sessions table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthSessionsTable extends AbstractMigration
21+
class CreateOauthSessionsTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthSessionsTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_sessions', function (Blueprint $table) {
30+
Schema::create('oauth_sessions', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->string('client_id', 40);
3233
$table->enum('owner_type', ['client', 'user'])->default('user');
@@ -50,9 +51,9 @@ public function up()
5051
*/
5152
public function down()
5253
{
53-
$this->schema()->table('oauth_sessions', function (Blueprint $table) {
54+
Schema::table('oauth_sessions', function (Blueprint $table) {
5455
$table->dropForeign('oauth_sessions_client_id_foreign');
5556
});
56-
$this->schema()->drop('oauth_sessions');
57+
Schema::drop('oauth_sessions');
5758
}
5859
}

database/migrations/2014_04_24_111109_create_oauth_session_scopes_table.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Illuminate\Database\Migrations\Migration;
1213
use Illuminate\Database\Schema\Blueprint;
13-
use LucaDegasperi\OAuth2Server\Support\AbstractMigration;
14+
use Illuminate\Support\Facades\Schema;
1415

1516
/**
1617
* This is the create oauth session scopes table migration class.
1718
*
1819
* @author Luca Degasperi <[email protected]>
1920
*/
20-
class CreateOauthSessionScopesTable extends AbstractMigration
21+
class CreateOauthSessionScopesTable extends Migration
2122
{
2223
/**
2324
* Run the migrations.
@@ -26,7 +27,7 @@ class CreateOauthSessionScopesTable extends AbstractMigration
2627
*/
2728
public function up()
2829
{
29-
$this->schema()->create('oauth_session_scopes', function (Blueprint $table) {
30+
Schema::create('oauth_session_scopes', function (Blueprint $table) {
3031
$table->increments('id');
3132
$table->integer('session_id')->unsigned();
3233
$table->string('scope_id', 40);
@@ -53,10 +54,10 @@ public function up()
5354
*/
5455
public function down()
5556
{
56-
$this->schema()->table('oauth_session_scopes', function (Blueprint $table) {
57+
Schema::table('oauth_session_scopes', function (Blueprint $table) {
5758
$table->dropForeign('oauth_session_scopes_session_id_foreign');
5859
$table->dropForeign('oauth_session_scopes_scope_id_foreign');
5960
});
60-
$this->schema()->drop('oauth_session_scopes');
61+
Schema::drop('oauth_session_scopes');
6162
}
6263
}

0 commit comments

Comments
 (0)