perf(db): composite index on wallet_transactions(user_id, type) (M14)
Helps the per-type SUM balance query. M13 (service_items.section_id) and M15 (clinic_doctor_invitations.doctor_id) were false positives — both columns carry a FK and are therefore auto-indexed by InnoDB; verified against the live schema. Structural regression: InfraSmokeTest::testWalletUserTypeIndexExists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ use Symfony\Component\Uid\Uuid;
|
||||
#[ORM\Entity(repositoryClass: WalletTransactionRepository::class)]
|
||||
#[ORM\Table(name: 'wallet_transactions')]
|
||||
#[ORM\Index(columns: ['user_id', 'created_at'], name: 'idx_wallet_user_date')]
|
||||
#[ORM\Index(columns: ['user_id', 'type'], name: 'idx_wallet_user_type')]
|
||||
class WalletTransaction
|
||||
{
|
||||
public const TYPE_CREDIT = 'credit';
|
||||
|
||||
Reference in New Issue
Block a user