Fixed problem with failing foreign key constraints on preview pic (1/2)

This commit is contained in:
Jan Böhmer 2023-02-20 00:06:00 +01:00
parent c39a9a4da7
commit 82aec6f1ee
3 changed files with 174 additions and 2 deletions

View file

@ -34,7 +34,7 @@ trait MasterAttachmentTrait
/**
* @var Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\Attachment")
* @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id")
* @ORM\JoinColumn(name="id_preview_attachment", referencedColumnName="id", onDelete="SET NULL", nullable=true)
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
*/
protected ?Attachment $master_picture_attachment = null;