You are here

function mailchimp_update_6201 in Mailchimp 6.2

Same name and namespace in other branches
  1. 7 mailchimp.install \mailchimp_update_6201()

Implementation of hook_update_N().

Create a new table for the queue.

When going from no queue to queue, we have to import everyone to the queue for the first pass. After that we can start adding people as required.

File

./mailchimp.install, line 49

Code

function mailchimp_update_6201() {
  $ret = array();
  $schema = drupal_get_schema_unprocessed('mailchimp', 'mailchimp_user');
  db_create_table($ret, 'mailchimp_user', $schema);

  // Everybody goes in here (exclude status = 0 here?)
  $ret[] = update_sql("INSERT INTO {mailchimp_user} (uid, status) SELECT uid, '" . MAILCHIMP_USERSTATUS_PENDING . "' FROM {users} WHERE uid > 0");
  return $ret;
}