Removed unique constrain from usernames

This commit is contained in:
Julian Prieber 2023-03-08 19:12:14 +01:00
parent ab3812b5a0
commit 19c6097a1c
2 changed files with 23 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class RegisteredUserController extends Controller
public function store(Request $request)
{
$request->validate([
'name' => 'required|string|max:255|unique:users',
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|confirmed|min:8',
]);

View File

@ -145,6 +145,28 @@ use Illuminate\Support\Facades\File;
]);
} catch (exception $e) {}
// Remove unique constrain from user names
class UpdateNameColumnInUsersTable extends Migration
{
public function up()
{
try {
Schema::table('users', function (Blueprint $table) {
$table->dropUnique('users_name_unique');
$table->string('name')->unique(false)->change();
});
} catch (\Throwable $th) {}
}
public function down()
{
try {
Schema::table('users', function (Blueprint $table) {
$table->string('name')->unique()->change();
});
} catch (\Throwable $th) {}
}
}
// Changes saved profile images from littlelink_name to IDs.
// This runs every time the updater runs.