Code cleanup [skip ci]

This commit is contained in:
James Cole
2018-03-11 20:41:03 +01:00
parent eb63090387
commit c8f52a1c40
10 changed files with 92 additions and 117 deletions

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
/**
/*
* 2018_01_01_000001_create_oauth_auth_codes_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
@@ -23,39 +21,37 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAuthCodesTable
*/
class CreateOauthAuthCodesTable extends Migration
{
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_auth_codes');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('oauth_auth_codes', function (Blueprint $table) {
Schema::create(
'oauth_auth_codes', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->integer('user_id');
$table->integer('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_auth_codes');
}
);
}
}

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
/**
/*
* 2018_01_01_000002_create_oauth_access_tokens_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAccessTokensTable
*/
class CreateOauthAccessTokensTable extends Migration
{
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_access_tokens');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('oauth_access_tokens', function (Blueprint $table) {
Schema::create(
'oauth_access_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->integer('user_id')->index()->nullable();
$table->integer('client_id');
@@ -48,16 +53,7 @@ class CreateOauthAccessTokensTable extends Migration
$table->boolean('revoked');
$table->timestamps();
$table->dateTime('expires_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_access_tokens');
}
);
}
}

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
/**
/*
* 2018_01_01_000003_create_oauth_refresh_tokens_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
@@ -23,37 +21,35 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthRefreshTokensTable
*/
class CreateOauthRefreshTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_refresh_tokens');
}
/**
* Run the migrations.
*/
public function up()
{
Schema::create(
'oauth_refresh_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
}
);
}
}

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
/**
/*
* 2018_01_01_000004_create_oauth_clients_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthClientsTable
*/
class CreateOauthClientsTable extends Migration
{
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_clients');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('oauth_clients', function (Blueprint $table) {
Schema::create(
'oauth_clients', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->index()->nullable();
$table->string('name');
@@ -49,16 +54,7 @@ class CreateOauthClientsTable extends Migration
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_clients');
}
);
}
}

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
/**
/*
* 2018_01_01_000005_create_oauth_personal_access_clients_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
@@ -23,36 +21,34 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthPersonalAccessClientsTable
*/
class CreateOauthPersonalAccessClientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_personal_access_clients');
}
/**
* Run the migrations.
*/
public function up()
{
Schema::create(
'oauth_personal_access_clients', function (Blueprint $table) {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
}
);
}
}