complete setup.', array ( '@initCount' => $init_count, '@count' => $count, '!link' => url(QBF_PATH_SETTINGS), ))); switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': $sq = 'CREATE TABLE {qbf_queries} ' .' ( ' ." `qid` INT(10) NOT NULL DEFAULT '0' COMMENT 'Query ID', " ." `uid` INT(10) NOT NULL DEFAULT '0' COMMENT 'User ID', " ." `name` VARCHAR(40) NOT NULL DEFAULT '' COMMENT 'Query name', " ." `query` TEXT NOT NULL COMMENT 'Query array', " ." `created` INT(10) NOT NULL DEFAULT '0' COMMENT 'Creation timestamp', " ." `updated` INT(10) NOT NULL DEFAULT '0' COMMENT 'Update timestamp', " .' PRIMARY KEY (`qid`) , ' .' KEY `uid` (`uid`), ' .' KEY `updated`(`updated`) ' .' ) ' .'ENGINE = MyISAM ' .'CHARACTER SET = utf8 ' ."COMMENT = 'QBF Query store' "; db_query($sq); break; case pgsql: default: drupal_set_message(t('Unsupported database backend for QBF module: @db', array('@db' => $GLOBALS['db_type'])), 'error'); break; } } /** * Implement hook_uninstall(). * * - Drop all the tables maintained by the module * - qbf_queries * - Remove nodes of all the types maintained by the module * - none * - Remove module settings * - none * - Do NOT remove module schema version from {system} * * @ingroup hooks * @return void */ function qbf_uninstall() { // Remove settings $ar_const = get_defined_constants(); $ar_const = array_keys($ar_const); foreach ($ar_const as $name) { if (strpos($name, 'QBF_VAR_') === 0) { variable_del($name); } } drupal_set_message(t('Removed QBF module settings.')); switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': case 'pgsql': db_query("DROP TABLE {qbf_queries}"); break; default: drupal_set_message(t('Unsupported database backend for QBF module: @db', array('@db' => $GLOBALS['db_type'])), 'error'); break; } } /** * Implement hook_update_N(). * * For now, just define a proper initial schema version. * * @ingroup hooks * @return array */ function qbf_update_5000() { return array(); }