Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Commerce
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2020 at 20:39 UTC
Updated:
22 Jul 2021 at 12:05 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
joelpittetComment #3
joelpittetComment #5
berdirI commented on #2907367: Add indexes to important fields because that was easier.
Also, if that change is already in HEAD then this is imho at least a major bug.
Comment #6
berdirNot *quite* the same, but you should just need to do something like this for each affected field:
Comment #7
joelpittetThank you very much @Berdir, it worked very well, the indexes are there and the schema is now updated. I removed
public function onEntityTypeUpdateComment #8
joelpittetComment #9
berdirLooks good to me. The onEntityTypeUpdate() might have created the necessary indexes but didn't update the installed field storage definitions.
I'd love to have a better system for this in core that doesn't require custom storage schemas and this seems like a pretty nice start, but things get a bit more complicated once you need indexes that cover multiple fields or unique indexes, fields with multiple properties (e.g. not sure what would happen with the commerce implementation if you try to put an index on a price field).
Comment #10
dave kopecekI can confirm the RTBC. Thanks to all who worked on this!
Comment #12
jsacksick commentedCommitted! Thanks!
Comment #14
darrenwh commentedI've found another field that needs indexing, adding it to field_indexes and the rerunning the update script does not add an index to the additional field, should it do? https://www.drupal.org/project/commerce/issues/3224681