You are here

function simplenews_update_7001 in Simplenews 7

Same name and namespace in other branches
  1. 7.2 simplenews.install \simplenews_update_7001()

Create key snid_tid on simplenews_mail_spool table.

File

./simplenews.install, line 741
Install, update and uninstall functions for the simplenews module

Code

function simplenews_update_7001() {

  // Add the {simplenews_mail_spool}.snid field if it doesn't exist yet (added
  // in 6.x-2.x).
  if (!db_field_exists('simplenews_mail_spool', 'snid')) {
    db_add_field('simplenews_mail_spool', 'snid', array(
      'description' => 'Foreign key for subscriber table ({simplenews_subscriptions}.snid)',
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ));
  }
  if (!db_index_exists('simplenews_mail_spool', 'snid_tid')) {
    db_add_index('simplenews_mail_spool', 'snid_tid', array(
      'snid',
      'tid',
    ));
  }
}