Replies: 2 comments 2 replies
-
it has unique constraint on ('name', 'guard_name'), you break something |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ah, ok. I didn't realise it was added in v4. Is there a command that needs to be run to add the indexes for an existing table? We can't re-create these tables from scratch at this point. I'm guessing what happened is that we had a v3.x version when we first migrated the tables and since then we've upgraded to v4.4 but still don't have the unique indexes on Thanks |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
Recently on a project which uses Laravel Permission, we noticed we had an issue where one of our apps was getting duplicate roles in the 'web' guard. So we had something like this as a result in our
roles
table:Solution
Add a UNIQUE Key constraint on ('name', 'guard_name') on the
roles
table so each guard cannot have more than one occurrence of a name.I can't see a reason you'd ever want duplicates within a guard_name.
Beta Was this translation helpful? Give feedback.
All reactions