fix(db): business-key unique constraints (M16-M19)
Add unique constraints (one migration, no dup data in either DB): - users.email, users.national_code (M16) — NULLs still allowed. - payments.gateway_token (M17). - date_overrides (doctor_id, date) (M18) — was a non-unique index. - financial_breakdowns (payment_id, source) (M19) — anti double-accounting. Regression: tests/Database/UniqueConstraintsTest (4 duplicate-insert cases). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@ class Payment
|
||||
#[ORM\Column(type: 'string', length: 30)]
|
||||
private string $type;
|
||||
|
||||
#[ORM\Column(name: 'gateway_token', type: 'string', length: 255, nullable: true)]
|
||||
#[ORM\Column(name: 'gateway_token', type: 'string', length: 255, nullable: true, unique: true)]
|
||||
private ?string $gatewayToken = null;
|
||||
|
||||
#[ORM\Column(name: 'reference_id', type: 'string', length: 255, nullable: true, unique: true)]
|
||||
|
||||
Reference in New Issue
Block a user