Fix for schema doesn't install

  1. <?php
  2. // $Id: letters.install,v 1.2 2007/11/07 16:31:47 seanr Exp $
  3. function letters_install() {
  4.   drupal_install_schema('letters');
  5. }
  6.  
  7. function letters_uninstall() {
  8.   drupal_uninstall_schema('letters');
  9. }
  10.  
  11. /**
  12. * Implementation of hook_schema().
  13. */
  14. function letters_schema() {
  15.   $schema['letters_newspapers'] = array(
  16.     'fields' => array(
  17.       'newsid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
  18.       'title' => array('type' => 'varchar', 'not null' => TRUE, 'length' => 255),
  19.       'address' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 255),
  20.       'city' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 255),
  21.       'state' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 2),
  22.       'zip' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 10),
  23.       'phone' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 15),
  24.       'fax' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 15),
  25.       'email' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 255),
  26.       'homepage' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 255),
  27.       'statewide' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
  28.     ),
  29.     'indexes' => array(
  30.       'letters_zip' => array('zip')
  31.     ),
  32.     'primary key' => array('newsid'),
  33.   );
  34. }

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.