Differential D2494 Diff 6958 src/database/migrations/2016_06_01_000004_create_oauth_clients_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2016_06_01_000004_create_oauth_clients_table.php
- This file was added.
<?php | |||||
use Illuminate\Database\Migrations\Migration; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Support\Facades\Schema; | |||||
class CreateOauthClientsTable 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. | |||||
* | |||||
* @return string|null | |||||
*/ | |||||
public function getConnection() | |||||
{ | |||||
return config('passport.storage.database.connection'); | |||||
} | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
$this->schema->create('oauth_clients', function (Blueprint $table) { | |||||
$table->bigIncrements('id'); | |||||
$table->unsignedBigInteger('user_id')->nullable()->index(); | |||||
$table->string('name'); | |||||
$table->string('secret', 100)->nullable(); | |||||
$table->string('provider')->nullable(); | |||||
$table->text('redirect'); | |||||
$table->boolean('personal_access_client'); | |||||
$table->boolean('password_client'); | |||||
$table->boolean('revoked'); | |||||
$table->timestamps(); | |||||
}); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
$this->schema->dropIfExists('oauth_clients'); | |||||
} | |||||
} |