You are here

function simplenews_update_7202 in Simplenews 7.2

Rename columns, drop old database tables.

File

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

Code

function simplenews_update_7202() {
  db_change_field('simplenews_subscription', 'tid', 'newsletter_id', array(
    'description' => 'The newsletter ({simplenews_newsletter}.newsletter_id) the subscriber is subscribed to.',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field('simplenews_mail_spool', 'tid', 'newsletter_id', array(
    'description' => 'The {simplenews_newsletter}.newsletter_id this issue belongs to.',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_drop_table('simplenews_newsletter_old');
  db_drop_table('simplenews_category');
  $field_name = variable_get('simplenews_category_field', 'field_simplenews_term');
  field_delete_field($field_name);
  variable_del('simplenews_category_field');
  taxonomy_vocabulary_delete(taxonomy_vocabulary_machine_name_load('newsletter')->vid);
}