forum-oauth-center/migrations/2023_09_28_create_oauth_refresh_tokens_table.php
2023-09-30 09:20:01 +08:00

31 lines
941 B
PHP

<?php
/*
* This file is part of foskym/flarum-oauth-center.
*
* Copyright (c) 2023 FoskyM.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
if ($schema->hasTable('oauth_refresh_tokens')) {
return;
}
$schema->create('oauth_refresh_tokens', function (Blueprint $table) {
$table->increments('id');
$table->string('refresh_token', 40);
$table->string('client_id', 80);
$table->string('user_id', 80)->nullable();
$table->timestamp('expires');
$table->string('scope', 4000)->nullable();
});
},
'down' => function (Builder $schema) {
$schema->dropIfExists('oauth_refresh_tokens');
},
];