fix(db): declare onDelete on required FKs that had none
Eight required (nullable:false) FKs had no referential action. Set per the codebase's existing pattern: CASCADE for owned relations (doctor_insurances, doctor_secretaries), RESTRICT for owner/reference FKs (Doctor/Clinic.user_id, invited_by_id, subscription plan/period). Only the two CASCADE FKs need DDL — RESTRICT is the MySQL default.
This commit is contained in:
@@ -40,7 +40,7 @@ class DoctorSecretary
|
||||
private Doctor $doctor;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(name: 'secretary_id', referencedColumnName: 'id', nullable: false)]
|
||||
#[ORM\JoinColumn(name: 'secretary_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
|
||||
private User $secretary;
|
||||
|
||||
#[ORM\Column(name: 'owner_type', type: 'string', length: 10, options: ['default' => 'doctor'])]
|
||||
|
||||
Reference in New Issue
Block a user