From 11b4dcdd3467ef803b6b0870c5c55b0e2360727d Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Tue, 28 Jul 2026 17:19:35 +0330 Subject: [PATCH] fix(tenant): declare the wallet ledger index on the entity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 6 created idx_wallet_user_recorded_entity in the migration but never declared it on WalletTransaction, so doctrine:schema:validate reported the production database as out of sync with the mapping. The index itself is right — WalletTransactionRepository::findByUserForEnvironment filters on exactly (user_id, recorded_entity_type, recorded_entity_id). Only the attribute was missing. No migration is needed; the index already exists. This matters beyond tidiness: while validate is red it cannot be used to detect real drift. schema:validate is now green on both mapping and database. Co-Authored-By: Claude Opus 5 (1M context) --- src/Settlement/Entity/WalletTransaction.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Settlement/Entity/WalletTransaction.php b/src/Settlement/Entity/WalletTransaction.php index 96f83251..a73382fb 100644 --- a/src/Settlement/Entity/WalletTransaction.php +++ b/src/Settlement/Entity/WalletTransaction.php @@ -12,6 +12,8 @@ use Symfony\Component\Uid\Uuid; #[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')] +// دفترِ per-محیطِ یک شخص: WalletTransactionRepository::findByUserForEnvironment() +#[ORM\Index(columns: ['user_id', 'recorded_entity_type', 'recorded_entity_id'], name: 'idx_wallet_user_recorded_entity')] class WalletTransaction { public const TYPE_CREDIT = 'credit';