function commerce_order_update_8206 in Commerce Core 8.2
Clears the address book for all customers, to avoid duplicates.
File
- modules/
order/ commerce_order.install, line 115 - Install, update and uninstall functions for the Order module.
Code
function commerce_order_update_8206() {
// Bypass Entity API for better performance.
$database = \Drupal::database();
$database
->query("UPDATE {profile} SET uid = 0 WHERE type = 'customer'");
$database
->query("UPDATE {profile_revision} SET uid = 0 WHERE profile_id IN (SELECT profile_id FROM {profile} WHERE type = 'customer')");
}