Checkout: minimize registration data
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-06 09:23:01 +01:00
parent 29c3c42134
commit 33af04db1b
9 changed files with 105 additions and 157 deletions

View File

@@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if (! Schema::hasColumn('users', 'username')) {
return;
}
$driver = DB::getDriverName();
if ($driver === 'mysql') {
DB::statement('ALTER TABLE users MODIFY username VARCHAR(255) NULL');
return;
}
if ($driver === 'pgsql') {
DB::statement('ALTER TABLE users ALTER COLUMN username TYPE VARCHAR(255)');
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
if (! Schema::hasColumn('users', 'username')) {
return;
}
$driver = DB::getDriverName();
if ($driver === 'mysql') {
DB::statement('ALTER TABLE users MODIFY username VARCHAR(32) NULL');
return;
}
if ($driver === 'pgsql') {
DB::statement('ALTER TABLE users ALTER COLUMN username TYPE VARCHAR(32)');
}
}
};