Use ManyToOne instead of OneToOne for master_picture_attachment like before

This commit is contained in:
Jan Böhmer 2023-07-20 21:54:13 +02:00
parent c0f626e9bd
commit 2e8cb35acc
12 changed files with 12 additions and 12 deletions

View file

@ -63,7 +63,7 @@ class AttachmentType extends AbstractStructuralDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: AttachmentTypeAttachment::class)]
#[ORM\ManyToOne(targetEntity: AttachmentTypeAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -70,7 +70,7 @@ class LabelProfile extends AttachmentContainingDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: AttachmentTypeAttachment::class)]
#[ORM\ManyToOne(targetEntity: AttachmentTypeAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -120,7 +120,7 @@ class Category extends AbstractPartsContainingDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: CategoryAttachment::class)]
#[ORM\ManyToOne(targetEntity: CategoryAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -61,7 +61,7 @@ class Footprint extends AbstractPartsContainingDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: FootprintAttachment::class)]
#[ORM\ManyToOne(targetEntity: FootprintAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -61,7 +61,7 @@ class Manufacturer extends AbstractCompany
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: ManufacturerAttachment::class)]
#[ORM\ManyToOne(targetEntity: ManufacturerAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -92,7 +92,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: MeasurementUnitAttachment::class)]
#[ORM\ManyToOne(targetEntity: MeasurementUnitAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -110,7 +110,7 @@ class Storelocation extends AbstractPartsContainingDBElement
#[ORM\OneToMany(targetEntity: StorelocationAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: StorelocationAttachment::class)]
#[ORM\ManyToOne(targetEntity: StorelocationAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -93,7 +93,7 @@ class Supplier extends AbstractCompany
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: SupplierAttachment::class)]
#[ORM\ManyToOne(targetEntity: SupplierAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -86,7 +86,7 @@ class Currency extends AbstractStructuralDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: CurrencyAttachment::class)]
#[ORM\ManyToOne(targetEntity: CurrencyAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -95,7 +95,7 @@ class Project extends AbstractStructuralDBElement
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: ProjectAttachment::class)]
#[ORM\ManyToOne(targetEntity: ProjectAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -78,7 +78,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: GroupAttachment::class)]
#[ORM\ManyToOne(targetEntity: GroupAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;

View file

@ -228,7 +228,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\OneToOne(targetEntity: UserAttachment::class)]
#[ORM\ManyToOne(targetEntity: UserAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
protected ?Attachment $master_picture_attachment = null;