fix для работы с vmangos

This commit is contained in:
2026-10-04 13:02:12 +04:00
parent 028aa9e35d
commit 5952e966d2
18 changed files with 400 additions and 163 deletions
@@ -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');
});
}
};