You are here

function backup_migrate_update_2001 in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 8.2 backup_migrate.install \backup_migrate_update_2001()
  2. 6.3 backup_migrate.install \backup_migrate_update_2001()
  3. 6.2 backup_migrate.install \backup_migrate_update_2001()
  4. 7.3 backup_migrate.install \backup_migrate_update_2001()
  5. 7.2 backup_migrate.install \backup_migrate_update_2001()

Adding filter field for dev release of 2009-01-28

File

./backup_migrate.install, line 334
Install hooks for Backup and Migrate.

Code

function backup_migrate_update_2001() {
  $ret = array();
  $schema = drupal_get_schema_unprocessed('backup_migrate', 'backup_migrate_profiles');

  // Add the filters field to the db.
  if (!db_field_exists('backup_migrate_profiles', 'filters')) {
    db_add_field('backup_migrate_profiles', 'filters', array(
      'description' => t('The filter settings for the profile.'),
      'type' => 'text',
      'not null' => TRUE,
    ));
  }

  // Add the source field
  if (!db_field_exists('backup_migrate_profiles', 'source_id')) {
    db_add_field('backup_migrate_profiles', 'source_id', array(
      'description' => t('The {backup_migrate_destination}.destination_id of the source to backup from.'),
      'type' => 'varchar',
      'length' => 255,
      'default' => 'db',
      'not null' => TRUE,
    ));
  }

  // Remove the compression field.
  if (db_field_exists('backup_migrate_profiles', 'compression')) {
    db_drop_field('backup_migrate_profiles', 'compression');
  }
  return $ret;
}