2020-12-26 18:24:20 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-12-26 18:24:20 +01:00
|
|
|
namespace Engelsystem\Migrations;
|
|
|
|
|
|
|
|
use Engelsystem\Database\Migration\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class OauthAddTokens extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function up(): void
|
2020-12-26 18:24:20 +01:00
|
|
|
{
|
2023-02-08 21:53:58 +01:00
|
|
|
$this->schema->table('oauth', function (Blueprint $table): void {
|
|
|
|
$table->string('access_token')->nullable()->default(null)->after('identifier');
|
|
|
|
$table->string('refresh_token')->nullable()->default(null)->after('access_token');
|
|
|
|
$table->dateTime('expires_at')->nullable()->default(null)->after('refresh_token');
|
|
|
|
});
|
2020-12-26 18:24:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function down(): void
|
2020-12-26 18:24:20 +01:00
|
|
|
{
|
2023-02-08 21:53:58 +01:00
|
|
|
$this->schema->table('oauth', function (Blueprint $table): void {
|
|
|
|
$table->dropColumn('access_token');
|
|
|
|
$table->dropColumn('refresh_token');
|
|
|
|
$table->dropColumn('expires_at');
|
|
|
|
});
|
2020-12-26 18:24:20 +01:00
|
|
|
}
|
|
|
|
}
|