We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Duplicate entry 'roles_name_guard_name_unique'
1 parent 46fc8f2 commit 626b3aeCopy full SHA for 626b3ae
database/migrations/add_teams_fields.php.stub
@@ -31,8 +31,11 @@ class AddTeamsFields extends Migration
31
32
if (! Schema::hasColumn($tableNames['roles'], $columnNames['team_foreign_key'])) {
33
Schema::table($tableNames['roles'], function (Blueprint $table) use ($columnNames) {
34
- $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
+ $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable()->after('id');
35
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
36
+
37
+ $table->dropUnique('roles_name_guard_name_unique');
38
+ $table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
39
});
40
}
41
0 commit comments