After upgrading from Drupal 5 to Drupal 6, mail_logger stopped working because the database is not updated.

I had a brief look at mail_logger.install and I see that there is no upgrade path offered.

The only way to upgrade is to disable the module, disinstall, thereby removing the {mail_logger} table and all its data, and reenable it again.

Comments

litwol’s picture

Priority: Critical » Normal
Status: Active » Closed (won't fix)

Yes its by design. If some one is interested in this enough to create upgrade path i will gladly commit it.

beginner’s picture

Priority: Normal » Critical
Status: Closed (won't fix) » Active

Nothing has been fixed. leave the issues open at least for the sake of the other users so that they don't suffer the problems I encountered because of those bugs.
If you prematurely close the issues, they won't be visible and it's neither me nor you who will suffer the consequences of not knowing about this issue.

deekayen’s picture

Status: Active » Needs review
function mail_logger_update_6000() {
  $ret = array();
  db_add_column($ret, 'mail_logger', 'language', 'varchar', array(
    'description'   => t('Language code'),
    'length'        => 20,
    'not null'      => TRUE,
    // default is required for PostreSQL according to http://api.drupal.org/api/function/db_add_column/6
    'default'       => "''"
  ));
  db_add_index($ret, 'mail_logger', 'language', 'language');
}
deekayen’s picture

Status: Needs review » Needs work

buggy... making a revision right now

deekayen’s picture

Status: Needs work » Needs review
function mail_logger_update_6000() {
  $ret = array();
  db_add_field($ret, 'mail_logger', 'language', array(
      'description'   => t('Language code'),
      'type'          => 'varchar',
      'length'        => 20,
      'not null'      => TRUE,
    )
  );
  db_add_index($ret, 'mail_logger', '`language`', array('`language`'));
  return $ret;
}
litwol’s picture

Can some one review this to make sure it runs ? I dont use this module on any of my sites so i have no data to test it with.

deekayen’s picture

Status: Needs review » Fixed

I wrapped it in a db_column_exists check since it's been so long, that way it'll be ignored by people who started with this module installing as Drupal 6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.