Skip to content

Commit

Permalink
fix(user): enforce uniqueness on display names (#2528)
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Aug 31, 2024
1 parent d40aab6 commit ddad15a
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration {
public function up(): void
{
Schema::table('UserAccounts', function (Blueprint $table) {
$table->unique('display_name');
});
}

public function down(): void
{
Schema::table('UserAccounts', function (Blueprint $table) {
$table->dropUnique(['display_name']);
});
}
};

0 comments on commit ddad15a

Please sign in to comment.