fix(tenant): declare the wallet ledger index on the entity
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user