You are here

search_files_attachments.install in Search Files 7.2

Same filename and directory in other branches
  1. 6.2 search_files_attachments.install

Installation and update procedures for the search_attachments module.

File

search_files_attachments.install
View source
<?php

/**
 * @file
 * Installation and update procedures for the search_attachments module.
 */

/* http://drupal.org/node/114774#hook-update-N
 */
function search_files_attachments_update_6200() {
  $ret = array();
  $result = db_result(db_query_range("\n              SELECT status FROM {system}\n              WHERE name = 'search_attachments'\n                AND filename LIKE '%/search_files/modules/search_attachments/search_attachments.module'\n            "), 0, 1);
  if ($result != "") {
    db_query("\n        UPDATE {system}\n        SET status = '%s'\n        WHERE name = 'search_files_attachments'\n      ", $result);
    db_query("\n        DELETE FROM {system}\n        WHERE name = 'search_attachments'\n          AND filename LIKE '%/search_files/modules/search_attachments/search_attachments.module'\n      ");
  }
  return $ret;
}
function search_files_attachments_update_6201() {
  $ret = array();
  $ret = update_sql("UPDATE {search_dataset} SET type = 'search_files_att' WHERE type = 'attachment'");
  $ret = update_sql("UPDATE {search_index} SET type = 'search_files_att' WHERE type = 'attachment'");
  return $ret;
}
function search_files_attachments_uninstall() {
  db_query("DELETE FROM {search_dataset} WHERE type = 'search_files_att'");
  db_query("DELETE FROM {search_index} WHERE type = 'search_files_att'");
  db_query("DELETE FROM {variable} WHERE name LIKE 'search_files_attachments_%'");
}