You are here

function mailchimp_update_6201 in Mailchimp 7

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

Implements 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 45
Install, update and uninstall functions for the mailchimp module.

Code

function mailchimp_update_6201() {
  $ret = array();
  $schema = drupal_get_schema_unprocessed('mailchimp', 'mailchimp_user');
  db_create_table('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;
}