t('Table for holding title images attached to nodes'), 'fields' => array( 'nid' => array( 'description' => t('The primary identifier for a node'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'image' => array( 'description' => t('The image attached to the title of the node'), 'type' => 'varchar', 'length' => 255, 'default' => '', ), ), 'primary key' => array('nid', 'image'), ); $schema['image_title_menu'] = array( 'description' => t('Table for holding title images attached to hook_menu entries'), 'fields' => array( 'path' => array( 'description' => t('The primary identifier for a page provided using hook_menu'), 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, ), 'image' => array( 'description' => t('The image attached to the title of the hook_menu page'), 'type' => 'varchar', 'length' => 255, 'default' => '', ), ), 'primary key' => array('path'), ); return $schema; } /** * Implementation of hook_uninstall(). */ function image_title_uninstall() { drupal_uninstall_schema('image_title'); } /** * Update a site to Drupal 6! */ function image_title_update_6000() { $schema = image_title_schema(); $ret = array(); if (db_table_exists('image_title')) { //remove entries for nodes with no active title image db_query('DELETE FROM {image_title} WHERE status = 0'); //drop the status field - no longer required db_drop_field($ret, 'image_title', 'status'); //rename the table to reflect the specific purpose db_rename_table($ret, 'image_title', 'image_title_node'); } //create new table for handling hook_menu pages with title images db_create_table($ret, 'image_title_menu', $schema['image_title_menu']); return $ret; }