You are here

function advagg_js_compress_update_7200 in Advanced CSS/JS Aggregation 7.2

Upgrade AdvAgg JS Compress versions (6.x-1.x and 7.x-1.x) to 7.x-2.x.

File

advagg_js_compress/advagg_js_compress.install, line 64
Handles AdvAgg JS compress installation and upgrade tasks.

Code

function advagg_js_compress_update_7200(&$sandbox) {

  // Bail if old DB Table does not exist.
  if (!db_table_exists('cache_advagg_js_compress_inline') && !db_table_exists('cache_advagg_js_compress_file')) {
    return t('Nothing needed to happen in AdvAgg JS Compress.');
  }

  // Remove all old advagg css compress variables.
  db_delete('variable')
    ->condition('name', 'advagg_js%compress%', 'LIKE')
    ->execute();

  // Remove old schema.
  if (db_table_exists('cache_advagg_js_compress_inline')) {
    db_drop_table('cache_advagg_js_compress_inline');
  }
  if (db_table_exists('cache_advagg_js_compress_file')) {
    db_drop_table('cache_advagg_js_compress_file');
  }
  return t('Upgraded AdvAgg JS Compress to 7.x-2.x.');
}