Missing update path for D7 version:
- Add a CAPTCHA token column to captcha_sessions table.

db_add_field('captcha_sessions', 'token', array(
  'description' => 'One time CAPTCHA token.',
  'type' => 'varchar',
  'length' => 64,
  'not null' => FALSE,
));

- Rename the type field to captcha_type in captcha_points.

db_change_field('captcha_points', 'type', 'captcha_type', array(
  'description' => 'The challenge type to use.',
  'type' => 'varchar',
  'length' => 64,
));

Comments

soxofaan’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

From which version did you you upgrade? From a stable 6.x version or from an alpha/dev 7.x version? See the upgrade note in the release notes of CAPTCHA 7.x-1.0-alpha2:

In case you already tried/worked with CAPTCHA 7.x-1.0-alpha1: there is no upgrade path from 7.x-1.0-alpha1 and 7.x-1.0-alpha2. If you try to upgrade, you will get database errors. Instead, you should first uninstall the CAPTCHA module and reinstall 7.x-1.0-alpha2 (like a fresh install).

Upgrading from CAPTCHA 6.x-2.x (for Drupal 6) to 7.x-1.0-alpha2 should work however.

Anyway, the upgrade path you are talking about already exists, see captcha.install:


/**
 * Implementation of hook_update_N()
 * Add a CAPTCHA token column to captcha_sessions table.
 */
function captcha_update_6202() {
  $ret = array();
  db_add_column($ret, 'captcha_sessions', 'token', 'varchar(64)');
  return $ret;
}

/**
 * Implementation of hook_update_N()
 * Rename the type field to captcha_type in captcha_points.
 */
function captcha_update_6203() {
  $ret = array();
  db_change_field($ret, 'captcha_points', 'type', 'captcha_type', array('type' => 'varchar', 'length' => 64));
  return $ret;
}
arpeggio’s picture

Status: Postponed (maintainer needs more info) » Active

I upgraded from 7.x-1.0-alpha1... I see, there is no upgrade path from 7.x-1.0-alpha1 and 7.x-1.0-alpha2. As a workaround, is it safe to execute this code once:

db_add_field('captcha_sessions', 'token', array(
  'description' => 'One time CAPTCHA token.',
  'type' => 'varchar',
  'length' => 64,
  'not null' => FALSE,
));
db_change_field('captcha_points', 'type', 'captcha_type', array(
  'description' => 'The challenge type to use.',
  'type' => 'varchar',
  'length' => 64,
));

without uninstalling the CAPTCHA module and reinstall 7.x-1.0-alpha2? Thanks.

soxofaan’s picture

You could try if that is easier for you than uninstalling and reinstalling.
I guess it could work.

arpeggio’s picture

Is the data I will loose isn't that much if I uninstall and reinstall CAPTCHA? I'm worrying about how much effort I will spent restoring my working setup form 7.x-1.0-alpha1... on the other hand taking the workaround, I will face uncertainty that one day I will encounter serious bug...

wundo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)