fix для работы с vmangos
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function getConnection(): ?string
|
||||
{
|
||||
return app()->environment('testing') ? config('database.default') : config('moonwell.auth_connection');
|
||||
}
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
Schema::connection($this->getConnection())->table('site_credentials', function (Blueprint $table): void {
|
||||
// web.users lives in another database, so no cross-database foreign key.
|
||||
$table->unsignedBigInteger('web_user_id')->nullable()->unique();
|
||||
$table->char('salt_hex', 64)->nullable()->change();
|
||||
$table->char('verifier_hex', 64)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::connection($this->getConnection())->table('site_credentials', function (Blueprint $table): void {
|
||||
$table->dropUnique(['web_user_id']);
|
||||
$table->dropColumn('web_user_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user