$role) { variable_del('root_dir_'. $rid); variable_del('webfm_extensions_'. $rid); variable_del('webfm_uploadsize_'. $rid); variable_del('webfm_usersize_'. $rid); } if (module_exists('og')) { $groups = og_all_groups_options(); foreach ($groups as $gid => $group) { variable_del('root_dir_group_'. $gid); } } $types = node_get_types(); foreach ($types as $type) { if ($type->type) { variable_del('webfm_attach_'. $type->type); } } variable_del('webfm_file_perm_role'); variable_del('webfm_file_perm_mod'); variable_del('webfm_file_perm_attach'); variable_del('webfm_file_public'); variable_del('webfm_date_format'); variable_del('webfm_attach_new_window'); } /** * Implementation of hook_schema(). */ function webfm_schema() { $schema['webfm_file'] = array( 'fields' => array( 'fid' => array('type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE), 'uid' => array('type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'fpath' => array('type' => 'text', 'size' => 'medium', 'not null' => TRUE), 'fsize' => array('type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'fmime' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'ftitle' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE), 'fcreatedate' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), 'flang' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'fpublisher' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'fformat' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'fversion' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), 'perm' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0), 'dl_cnt' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), ), 'primary key' => array('fid'), ); $schema['webfm_attach'] = array( 'fields' => array( 'nid' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), 'fid' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), 'weight' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), 'cid' => array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'default' => 0), ), 'primary key' => array('nid', 'fid', 'cid' ), ); return $schema; } /** * Add column for comment id in webfm_attach table. */ function webfm_update_1() { $ret = array(); // Add the new column to store a comment id. db_add_field($ret, 'webfm_attach', 'cid', array('type' => 'int', 'not null' => TRUE, 'default' => '0')); // Make it a primary key. db_drop_primary_key($ret, 'webfm_attach'); db_add_primary_key($ret, 'webfm_attach', array('nid', 'cid', 'fid')); return $ret; }