You are here

function lingotek_update_7505 in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lingotek.install \lingotek_update_7505()
  2. 7.6 lingotek.install \lingotek_update_7505()

Remove unused entries from lingotek_entity_metadata table

File

./lingotek.install, line 795

Code

function lingotek_update_7505(&$sandbox) {
  lingotek_extend_metadata_tables();
  $delete = db_delete('lingotek_entity_metadata');
  $or = db_or();
  $or
    ->condition('entity_key', 'target_sync_progress_%', 'LIKE');
  $or
    ->condition('entity_key', 'target_sync_last_progress_updated_%', 'LIKE');
  $or
    ->condition('entity_key', 'target_last_downloaded_%', 'LIKE');
  $or
    ->condition('entity_key', 'translation_progress');
  $count = $delete
    ->condition($or)
    ->execute();
  return format_plural($count, 'Removed one unused entry from the <i>lingotek_entity_metadata</i> table.', 'Removed @count unused entries from the <i>lingotek_entity_metadata</i> table.');
}