t('TODO'), 'fields' => array( 'nid' => array( 'description' => t('Thi is to store the node id'), 'type' => 'int', 'unsigned' => 1, 'not null' => TRUE, 'default' => 0, ), 'field_table' => array( 'description' => t('The table in which the poll field is stored'), 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', ), 'field_name' => array( 'description' => t('The name of the poll field'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '', ), 'runtime' => array( 'description' => t('TODO'), 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), 'active' => array( 'description' => t('Whether the poll is active or not'), 'type' => 'int', 'unsigned' => 1, 'not null' => TRUE, 'default' => 0, ), ), 'primary key' => array('nid', 'field_table'), ); $schema['pollfield_votes'] = array( 'description' => t('This tabls stores all the pollfield results'), 'fields' => array( 'nid' => array( 'description' => t('The pollfield nid at which the poll is cast'), 'type' => 'int', 'unsigned' => 1, 'not null' => TRUE, ), 'field_table' => array( 'description' => t('The table in which the poll field is stored'), 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', ), 'field_name' => array( 'description' => t('The table in which the poll field is stored'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '', ), 'uid' => array( 'description' => t('The uid of the user who casted the vote'), 'type' => 'int', 'unsigned' => 1, 'not null' => TRUE, 'default' => 0, ), 'delta' => array( 'description' => t('TODO'), 'type' => 'int', 'not null' => TRUE, 'default' => -1, ), 'hostname' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', ), ), 'indexes' => array( 'nid' => array('nid'), 'uid' => array('uid'), 'field_table' => array('field_table'), 'hostname' => array('hostname'), ), ); return $schema; } /** * Implementation of hook_install(). */ function pollfield_install() { // Create tables. drupal_install_schema('pollfield'); } /** * Implementation of hook_uninstall(). */ function pollfield_uninstall() { // Remove tables. drupal_uninstall_schema('pollfield'); } /** * Implementation of hook_enable(). */ function pollfield_enable() { content_notify('enable', 'pollfield'); } /** * Implementation of hook_disable(). */ function pollfield_disable() { content_notify('disable', 'pollfield'); }