Follow-up to kessai #3610757, which makes kessai's PaymentStorageSchema extensible: it drops final and exposes a protected indexes() seam that a consumer overrides to add its own indexes.
orchestra_payment adds the orchestra_token base field to the kessai_payment entity and indexes it with a composite (orchestra_token, kind, state) index. Because kessai's PaymentStorageSchema was final, the bridge could not extend it: it extends SqlContentEntityStorageSchema directly and re-declares kessai's own kessai_payment__subject_kind index alongside its own, so swapping the storage-schema handler never drops the base index. That copy has to be kept in step with kessai by hand, which is exactly the drift risk kessai #3610757 was filed to remove.
Proposed change
- Change
Drupal\orchestra_payment\PaymentStorageSchemato extendDrupal\kessai\PaymentStorageSchemainstead ofSqlContentEntityStorageSchema. - Replace the
getEntitySchema()override with anindexes()override that returnsparent::indexes()merged with the bridge's (orchestra_token, kind, state) index. - Drop the re-declared
kessai_payment__subject_kindentry: it now comes from the parent, so there is no copy left to keep in step. - Update the class docblock and the PaymentIndexTest wording that mention the "final, cannot extend" workaround. The test assertions stay as they are (both indexes must still exist after the handler swap), so it keeps guarding the behavior.
Dependency
This depends on kessai #3610757 landing first. Once it is in a kessai release, raise orchestra_payment's kessai dependency to that version so the extensible base class is guaranteed to be present.
Issue fork orchestra-3610814
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #4
mably commented