You are here

function password_policy_update_7203 in Password Policy 7.2

Update history schema from 1.x.

File

./password_policy.install, line 212
Install functions for Password Policy module.

Code

function password_policy_update_7203() {
  if (db_field_exists('password_policy_history', 'pid')) {

    // Create temporary index to allow renaming primary key.
    db_add_index('password_policy_history', 'temp', array(
      'pid',
    ));
    db_drop_primary_key('password_policy_history');
    db_change_field('password_policy_history', 'pid', 'hid', array(
      'description' => 'Primary Key: Unique history ID.',
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ), array(
      'primary key' => array(
        'hid',
      ),
    ));
    db_drop_index('password_policy_history', 'temp');
  }
  db_change_field('password_policy_history', 'pass', 'pass', array(
    'description' => 'User\'s password (hashed).',
    'type' => 'varchar',
    'length' => 128,
    'not null' => TRUE,
    'default' => '',
  ), array());
}