You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But personally I miss the adaptation to the database migrations.
There is a risk of database errors here if a unique index is set on several columns and the softDeletes are not included at this point. The validation with Laravel works as expected, but the data record cannot be created in the database.
The simplest solution would of course be to specify the deleted_at column in the unique-call. But a generic approach might increase usability.
This discussion was converted from issue #38180 on July 30, 2021 09:57.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
With this PR - [8.x] Add ignoreTrashed to Unique validation rule we get a unique validation rule, that takes care of soft deleted records.
But personally I miss the adaptation to the database migrations.
There is a risk of database errors here if a unique index is set on several columns and the softDeletes are not included at this point. The validation with Laravel works as expected, but the data record cannot be created in the database.
The simplest solution would of course be to specify the deleted_at column in the
unique
-call. But a generic approach might increase usability.Steps To Reproduce:
Imagine a migration like this:
Beta Was this translation helpful? Give feedback.
All reactions