Skip to content

Commit

Permalink
UHF-8908: Mark entities as needs_update
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Mar 21, 2024
1 parent 39af4c3 commit ac2532c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helfi_tpr.install
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function helfi_tpr_update_8047() : void {
*/
function helfi_tpr_update_8048() : void {
$entityDefinitionManager = \Drupal::entityDefinitionUpdateManager();
$database = \Drupal::database();

foreach (['tpr_unit', 'tpr_service_channel'] as $entityType) {
$fieldDefinition = $entityDefinitionManager->getFieldStorageDefinition('email', $entityType);
Expand All @@ -367,5 +368,13 @@ function helfi_tpr_update_8048() : void {

\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('email', $entityType, 'helfi_tpr', $field);

// Mark migrate map as 'needs update'.
if (!$database->schema()->tableExists('migrate_map_' . $entityType)) {
return;
}
$database->update('migrate_map_' . $entityType)->fields([
'source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE,
])->execute();
}
}

0 comments on commit ac2532c

Please sign in to comment.