Skip to content
Snippets Groups Projects
Commit 6b0756e2 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2190695 by alexpott: Remove unnecessary update functions.

parent 3ae319e4
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -768,63 +768,6 @@ function update_retrieve_dependencies() {
return $return;
}
/**
* Helper function to update entities with uuid.
*
* @param array $sandbox
* A sandbox where conversion happens.
* @param string $table
* A table whose data should be updated.
* @param string $primary_key
* A $table primary key column.
* @param array $values
* A $primary_key values of rows to be updated.
*/
function update_add_uuids(&$sandbox, $table, $primary_key, $values) {
$uuid = \Drupal::service('uuid');
foreach ($values as $value) {
db_update($table)
->fields(array(
'uuid' => $uuid->generate(),
))
->condition($primary_key, $value)
->isNull('uuid')
->execute();
$sandbox['progress']++;
$sandbox['last'] = $value;
}
}
/**
* Adds tags, checksum_invalidations, checksum_deletions to a cache table.
*
* @param string $table
* Name of the cache table.
*/
function update_add_cache_columns($table) {
if (db_table_exists($table) && !db_field_exists($table, 'tags')) {
db_add_field($table, 'tags', array(
'description' => 'Space-separated list of cache tags for this entry.',
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
));
db_add_field($table, 'checksum_invalidations', array(
'description' => 'The tag invalidation sum when this entry was saved.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
));
db_add_field($table, 'checksum_deletions', array(
'description' => 'The tag deletion sum when this entry was saved.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
));
}
}
/**
* Replace permissions during update.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment