You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Authkit2UsersUpdateMinimal extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// These are split up like this as to not cause issues when running
// against sqlite.
Schema::table('users', static function(Blueprint $table) {
$table->string('password')->nullable()->change();
});
Schema::table('users', static function(BluePrint $table) {
$table->string('authkit_id')->unique()->nullable();
$table->text('authkit_access_token')->nullable();
$table->text('authkit_refresh_token')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', static function(Blueprint $table) {
$table->dropColumn(['authkit_id', 'authkit_access_token', 'authkit_refresh_token']);
$table->string('password')->nullable(false)->default(null)->change();
});
}
}