You are here

function simplenews_update_7008 in Simplenews 7.2

Same name and namespace in other branches
  1. 7 simplenews.install \simplenews_update_7008()

Add the timestamp and source columns to {simplenews_subscription} if missing.

File

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

Code

function simplenews_update_7008() {
  if (!db_field_exists('simplenews_subscription', 'timestamp')) {
    db_add_field('simplenews_subscription', 'timestamp', array(
      'description' => 'UNIX timestamp of when the user is (un)subscribed.',
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'default' => 0,
    ));
  }
  if (!db_field_exists('simplenews_subscription', 'source')) {
    db_add_field('simplenews_subscription', 'source', array(
      'description' => 'The source via which the user is (un)subscription.',
      'type' => 'varchar',
      'length' => 24,
      'not null' => TRUE,
      'default' => '',
    ));
  }
}