diff --git a/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php b/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php index 195685f7a..423661580 100644 --- a/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php +++ b/database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php @@ -4,25 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +return new class() extends Migration { - /** - * The database schema. - * - * @var \Illuminate\Database\Schema\Builder - */ - protected $schema; - - /** - * Create a new migration instance. - * - * @return void - */ - public function __construct() - { - $this->schema = Schema::connection($this->getConnection()); - } - /** * Run the migrations. * @@ -30,7 +13,9 @@ public function __construct() */ public function up() { - $this->schema->create('oauth_auth_codes', function (Blueprint $table) { + $schema = Schema::connection($this->getConnection()); + + $schema->create('oauth_auth_codes', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->unsignedBigInteger('user_id')->index(); $table->unsignedBigInteger('client_id'); @@ -47,7 +32,9 @@ public function up() */ public function down() { - $this->schema->dropIfExists('oauth_auth_codes'); + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('oauth_auth_codes'); } /** diff --git a/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php b/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php index c8ecd7227..d2c851361 100644 --- a/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php +++ b/database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php @@ -4,25 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +return new class() extends Migration { - /** - * The database schema. - * - * @var \Illuminate\Database\Schema\Builder - */ - protected $schema; - - /** - * Create a new migration instance. - * - * @return void - */ - public function __construct() - { - $this->schema = Schema::connection($this->getConnection()); - } - /** * Run the migrations. * @@ -30,7 +13,9 @@ public function __construct() */ public function up() { - $this->schema->create('oauth_access_tokens', function (Blueprint $table) { + $schema = Schema::connection($this->getConnection()); + + $schema->create('oauth_access_tokens', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->unsignedBigInteger('user_id')->nullable()->index(); $table->unsignedBigInteger('client_id'); @@ -49,7 +34,9 @@ public function up() */ public function down() { - $this->schema->dropIfExists('oauth_access_tokens'); + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('oauth_access_tokens'); } /** diff --git a/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php b/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php index 998b63158..1d5609568 100644 --- a/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php +++ b/database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php @@ -4,25 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +return new class() extends Migration { - /** - * The database schema. - * - * @var \Illuminate\Database\Schema\Builder - */ - protected $schema; - - /** - * Create a new migration instance. - * - * @return void - */ - public function __construct() - { - $this->schema = Schema::connection($this->getConnection()); - } - /** * Run the migrations. * @@ -30,7 +13,9 @@ public function __construct() */ public function up() { - $this->schema->create('oauth_refresh_tokens', function (Blueprint $table) { + $schema = Schema::connection($this->getConnection()); + + $schema->create('oauth_refresh_tokens', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->string('access_token_id', 100)->index(); $table->boolean('revoked'); @@ -45,7 +30,9 @@ public function up() */ public function down() { - $this->schema->dropIfExists('oauth_refresh_tokens'); + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('oauth_refresh_tokens'); } /** diff --git a/database/migrations/2016_06_01_000004_create_oauth_clients_table.php b/database/migrations/2016_06_01_000004_create_oauth_clients_table.php index 51e597c2b..743039fe8 100644 --- a/database/migrations/2016_06_01_000004_create_oauth_clients_table.php +++ b/database/migrations/2016_06_01_000004_create_oauth_clients_table.php @@ -4,25 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +return new class() extends Migration { - /** - * The database schema. - * - * @var \Illuminate\Database\Schema\Builder - */ - protected $schema; - - /** - * Create a new migration instance. - * - * @return void - */ - public function __construct() - { - $this->schema = Schema::connection($this->getConnection()); - } - /** * Get the migration connection name. * @@ -40,7 +23,9 @@ public function getConnection() */ public function up() { - $this->schema->create('oauth_clients', function (Blueprint $table) { + $schema = Schema::connection($this->getConnection()); + + $schema->create('oauth_clients', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('user_id')->nullable()->index(); $table->string('name'); @@ -61,6 +46,8 @@ public function up() */ public function down() { - $this->schema->dropIfExists('oauth_clients'); + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('oauth_clients'); } }; diff --git a/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php b/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php index e12920ab7..fad9afade 100644 --- a/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php +++ b/database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php @@ -4,25 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +return new class() extends Migration { - /** - * The database schema. - * - * @var \Illuminate\Database\Schema\Builder - */ - protected $schema; - - /** - * Create a new migration instance. - * - * @return void - */ - public function __construct() - { - $this->schema = Schema::connection($this->getConnection()); - } - /** * Run the migrations. * @@ -30,7 +13,9 @@ public function __construct() */ public function up() { - $this->schema->create('oauth_personal_access_clients', function (Blueprint $table) { + $schema = Schema::connection($this->getConnection()); + + $schema->create('oauth_personal_access_clients', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('client_id'); $table->timestamps(); @@ -44,7 +29,9 @@ public function up() */ public function down() { - $this->schema->dropIfExists('oauth_personal_access_clients'); + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('oauth_personal_access_clients'); } /**