Update hook to populate all log owner fields with the log's author.

This commit is contained in:
Michael Stenta 2017-06-12 16:43:59 -04:00
parent 559c6a13dc
commit 5617924ab2
1 changed files with 9 additions and 0 deletions

View File

@ -523,6 +523,15 @@ function farm_update_7023(&$sandbox) {
variable_set('theme_farm_theme_settings', $theme_settings);
}
/**
* Populate all log owner fields with the log's author.
*/
function farm_update_7024(&$sandbox) {
$select = "SELECT 'log' AS entity_type, type AS bundle, 0 AS deleted, id AS entity_id, id AS revision_id, 'und' AS language, 0 AS delta, uid AS field_farm_log_owner_target_id FROM {log}";
db_query('INSERT INTO {field_data_field_farm_log_owner} (' . $select . ')');
db_query('INSERT INTO {field_revision_field_farm_log_owner} (' . $select . ')');
}
/**
* Update helper function: enable modules.
*/