Hi All,
I have tried to install a table and it keeps failing. The code is as follows - what might be wrong with it?
<?php// $Id$/** * Implementation of hook_install(). */function locationverify_install() { // Use schema API to create database table. drupal_install_schema('locationverify');}/** * Implementation of hook_uninstall(). */function locationverify_uninstall() { // Use schema API to delete database table. drupal_uninstall_schema('locationverify'); // Delete our module's variable from the variables table. variable_del('locationverify_node_types');}/** * Implementation of hook_schema(). */function locationverify_schema() { $schema['location_verify'] = array( 'description' => t('Tracks all location updates, changes and verifications.'), 'fields' => array( 'locverkey' => array( 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Primary Key'), ), 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'description' => t('The {node}.nid to which the location info applies.'), ), 'uid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'description' => t('The user requesting the change.'), ), 'vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'description' => t('The vid to which the location info applies.'), ), 'lastvid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'description' => t('The last accepted vid location.'), ), 'ownerchange' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('Is the uid the verified owner of this nid?'), ), 'changes' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('What changed (0-nochange,1-ch: name,chain,loc,strnu,strna,city,state,post,phone'), ), 'typeofchange' => array( 'type' => 'text', 'not null' => TRUE, 'default' => 'unk', 'description' => t('Type of change made: unk,new,sbnl,nbsl,check,verify'), ), 'gnameold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - name'), ), 'glocold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - loc, if applicable'), ), 'gstrold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - street'), ), 'gcityold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - city'), ), 'gstateold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - state/region/nation'), ), 'gpostold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - post - postal code'), ), 'gphoneold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - phone'), ), 'gnamenew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - name'), ), 'glocnew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - loc, if applicable'), ), 'gstrnew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - street'), ), 'gcitynew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - city'), ), 'gstatenew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - state/region/nation'), ), 'gpostnew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - post - postal code'), ), 'gphonenew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned data if inserting new address - phone'), ), 'ghitold' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned hits for last verified address'), ), 'ghitnew' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('search API returned hits for this proposed address'), ), 'stepstaken' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('Actions taken: a-email owner,b-call verified phone,c-mail ver address'), ), 'totalactions' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => t('Total number of actions, two steps done together counts as one action'), ), 'timeoflaststep' => array( 'description' => t('A unix timestamp indicating time of last action.'), 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), 'decision' => array( 'type' => 'text', 'not null' => FALSE, 'description' => t('Manual decision(s): 1-accept,2-email,3-phone,4-mail,5-rejadd1x,6-rejadd2x,7-rejall2x,8-rejall3x,9-ban4x'), ), 'resolved' => array( 'type' => 'text', 'not null' => TRUE, 'default' => 'n', 'description' => t('Has this been resolved?'), ), 'timeofresolution' => array( 'description' => t('A unix timestamp indicating when issue was finally resolved.'), 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), ), 'primary key' => array('locverkey'), ); return $schema;}
Thanks,
Rob