Fix for hook_install doesn't seem to work

  1. <?php
  2. /**
  3.  * Implemenation of hook_install()
  4.  */
  5. function tnt_user_import_install() {
  6.         // Create tables.
  7.         drupal_install_schema('tnt_user_import_schema');
  8. }
  9.  
  10. /**
  11.  * Implementation of hook_uninstall().
  12.  */
  13. function tnt_user_import_uninstall() {
  14.         // Remove tables.
  15.         drupal_uninstall_schema('tnt_user_import_schema');
  16. }
  17.  
  18. /**
  19.  * Implementation of hook_schema().
  20.  */
  21. function tnt_user_import_schema() {
  22.         $schema = array();
  23.  
  24.         $schema['users_tnt_user_import'] = array(
  25.                 'fields' => array(
  26.                         'title'         => array('type' => 'varchar', 'length' => '32'),
  27.                         'firstname' => array('type' => 'varchar', 'length' => '32'),
  28.                         'lastname'      => array('type' => 'varchar', 'length' => '64'),
  29.                         'account'       => array('type' => 'int', 'size' => 'normal'),
  30.                         'company'       => array('type' => 'varchar', 'length' => '255'),
  31.                         'street'        => array('type' => 'varchar', 'length' => '64'),
  32.                         'street_nr'     => array('type' => 'varchar', 'length' => '12'),
  33.                         'address_opt' => array('type' => 'varchar', 'length' => '128'),
  34.                         'zipcode'       => array('type' => 'varchar', 'length' => '12'),
  35.                         'city'          => array('type' => 'varchar', 'length' => '32'),
  36.                         'phone'         => array('type' => 'varchar', 'length' => '16'),
  37.                         'check_legal' => array('type' => 'int', 'size' => 'normal'),
  38.                         'check_news' => array('type' => 'int', 'size' => 'normal'),
  39.                         'speedpoints' => array('type' => 'int', 'size' => 'normal')
  40.                 ),
  41.         'primary key' => array('uid'),
  42.                 'indexes' => array(
  43.                         'account' => array('account'),
  44.                 ),
  45.         );
  46.         return $schema;
  47. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.