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:
hamed
2026-06-28 17:04:23 +03:30
parent 372bea4849
commit 36b87e9817
8 changed files with 43 additions and 8 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class DoctorInsurance
private Doctor $doctor;
#[ORM\ManyToOne(targetEntity: Insurance::class)]
#[ORM\JoinColumn(name: 'insurance_id', referencedColumnName: 'id', nullable: false)]
#[ORM\JoinColumn(name: 'insurance_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private Insurance $insurance;
#[ORM\Column(type: 'integer', nullable: true)]