Adam
2 years ago
committed by
GitHub
2 changed files with 23 additions and 1 deletions
@ -0,0 +1,20 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* @file |
||||
* Post-update hooks. |
||||
*/ |
||||
|
||||
/** |
||||
* Add index to field_weight. |
||||
*/ |
||||
function islandora_core_feature_post_update_add_index_to_field_weight() { |
||||
$storage = \Drupal::entityTypeManager()->getStorage('field_storage_config'); |
||||
$field = $storage->load('node.field_weight'); |
||||
$indexes = $field->getIndexes(); |
||||
$indexes += [ |
||||
'value' => ['value'], |
||||
]; |
||||
$field->setIndexes($indexes); |
||||
$field->save(); |
||||
} |
Loading…
Reference in new issue