Enforce unique names for attachments (per attachment type and part)

This commit is contained in:
Jan Böhmer 2020-03-30 16:01:00 +02:00
parent 7bda340368
commit 41df76e8e6
12 changed files with 24 additions and 0 deletions

View file

@ -44,11 +44,13 @@ namespace App\Entity\Attachments;
use App\Entity\UserSystem\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a user element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
class UserAttachment extends Attachment
{