diff options
Diffstat (limited to 'modules/search/helpers/search_installer.php')
| -rw-r--r-- | modules/search/helpers/search_installer.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/search/helpers/search_installer.php b/modules/search/helpers/search_installer.php index a3d0f79e..5fc9b37b 100644 --- a/modules/search/helpers/search_installer.php +++ b/modules/search/helpers/search_installer.php @@ -31,18 +31,23 @@ class search_installer { KEY(`item_id`), FULLTEXT INDEX (`data`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;"); - - // populate the index with dirty records - $db->query("INSERT INTO {search_records} (`item_id`) SELECT `id` FROM {items}"); module::set_version("search", 1); + } + } + + static function activate() { + // Update the root item. This is a quick hack because the search module is activated as part + // of the official install, so this way we don't start off with a "your index is out of date" + // banner. + search::update(model_cache::get("item", 1)); search::check_index(); } + + static function deactivate() { + site_status::clear("search_index_out_of_date"); } static function uninstall() { - $db = Database::instance(); - $db->query("DROP TABLE {search_records}"); - site_status::clear("search_index_out_of_date"); - module::delete("search"); + Database::instance()->query("DROP TABLE {search_records}"); } } |
