mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-28 07:50:23 +05:30
commit
7fff4a8fe8
@ -102,7 +102,7 @@ Capsule::table('oauth_scopes')->insert([
|
|||||||
print 'Creating sessions table'.PHP_EOL;
|
print 'Creating sessions table'.PHP_EOL;
|
||||||
|
|
||||||
Capsule::schema()->create('oauth_sessions', function ($table) {
|
Capsule::schema()->create('oauth_sessions', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id')->unsigned();
|
||||||
$table->string('owner_type');
|
$table->string('owner_type');
|
||||||
$table->string('owner_id');
|
$table->string('owner_id');
|
||||||
$table->string('client_id');
|
$table->string('client_id');
|
||||||
@ -135,7 +135,7 @@ print 'Creating access tokens table'.PHP_EOL;
|
|||||||
|
|
||||||
Capsule::schema()->create('oauth_access_tokens', function ($table) {
|
Capsule::schema()->create('oauth_access_tokens', function ($table) {
|
||||||
$table->string('access_token')->primary();
|
$table->string('access_token')->primary();
|
||||||
$table->integer('session_id');
|
$table->integer('session_id')->unsigned();
|
||||||
$table->integer('expire_time');
|
$table->integer('expire_time');
|
||||||
|
|
||||||
$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
|
$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
|
||||||
@ -168,7 +168,7 @@ Capsule::schema()->create('oauth_refresh_tokens', function ($table) {
|
|||||||
$table->integer('expire_time');
|
$table->integer('expire_time');
|
||||||
$table->string('access_token');
|
$table->string('access_token');
|
||||||
|
|
||||||
$table->foreign('access_token')->references('id')->on('oauth_access_tokens')->onDelete('cascade');
|
$table->foreign('access_token')->references('access_token')->on('oauth_access_tokens')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -177,7 +177,7 @@ print 'Creating auth codes table'.PHP_EOL;
|
|||||||
|
|
||||||
Capsule::schema()->create('oauth_auth_codes', function ($table) {
|
Capsule::schema()->create('oauth_auth_codes', function ($table) {
|
||||||
$table->string('auth_code')->primary();
|
$table->string('auth_code')->primary();
|
||||||
$table->integer('session_id');
|
$table->integer('session_id')->unsigned();
|
||||||
$table->integer('expire_time');
|
$table->integer('expire_time');
|
||||||
$table->string('client_redirect_uri');
|
$table->string('client_redirect_uri');
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ Capsule::schema()->create('oauth_auth_codes', function ($table) {
|
|||||||
print 'Creating oauth access token scopes table'.PHP_EOL;
|
print 'Creating oauth access token scopes table'.PHP_EOL;
|
||||||
|
|
||||||
Capsule::schema()->create('oauth_access_token_scopes', function ($table) {
|
Capsule::schema()->create('oauth_access_token_scopes', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id')->unsigned();
|
||||||
$table->string('access_token');
|
$table->string('access_token');
|
||||||
$table->string('scope');
|
$table->string('scope');
|
||||||
|
|
||||||
@ -240,8 +240,8 @@ Capsule::schema()->create('oauth_auth_code_scopes', function ($table) {
|
|||||||
print 'Creating oauth session scopes table'.PHP_EOL;
|
print 'Creating oauth session scopes table'.PHP_EOL;
|
||||||
|
|
||||||
Capsule::schema()->create('oauth_session_scopes', function ($table) {
|
Capsule::schema()->create('oauth_session_scopes', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id')->unsigned();
|
||||||
$table->string('session_id');
|
$table->integer('session_id')->unsigned();
|
||||||
$table->string('scope');
|
$table->string('scope');
|
||||||
|
|
||||||
$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
|
$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
|
||||||
|
Loading…
Reference in New Issue
Block a user